this.$ = this.$ || {};
this.$.DW = (function () {
  'use strict';

  function _typeof(obj) {
    "@babel/helpers - typeof";

    if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
      _typeof = function (obj) {
        return typeof obj;
      };
    } else {
      _typeof = function (obj) {
        return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
      };
    }

    return _typeof(obj);
  }

  function _classCallCheck(instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
  }

  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }

  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties(Constructor, staticProps);
    return Constructor;
  }

  function _defineProperty(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }

    return obj;
  }

  function _inherits(subClass, superClass) {
    if (typeof superClass !== "function" && superClass !== null) {
      throw new TypeError("Super expression must either be null or a function");
    }

    subClass.prototype = Object.create(superClass && superClass.prototype, {
      constructor: {
        value: subClass,
        writable: true,
        configurable: true
      }
    });
    if (superClass) _setPrototypeOf(subClass, superClass);
  }

  function _getPrototypeOf(o) {
    _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
      return o.__proto__ || Object.getPrototypeOf(o);
    };
    return _getPrototypeOf(o);
  }

  function _setPrototypeOf(o, p) {
    _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
      o.__proto__ = p;
      return o;
    };

    return _setPrototypeOf(o, p);
  }

  function _isNativeReflectConstruct() {
    if (typeof Reflect === "undefined" || !Reflect.construct) return false;
    if (Reflect.construct.sham) return false;
    if (typeof Proxy === "function") return true;

    try {
      Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
      return true;
    } catch (e) {
      return false;
    }
  }

  function _assertThisInitialized(self) {
    if (self === void 0) {
      throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
    }

    return self;
  }

  function _possibleConstructorReturn(self, call) {
    if (call && (typeof call === "object" || typeof call === "function")) {
      return call;
    } else if (call !== void 0) {
      throw new TypeError("Derived constructors may only return object or undefined");
    }

    return _assertThisInitialized(self);
  }

  function _createSuper(Derived) {
    var hasNativeReflectConstruct = _isNativeReflectConstruct();

    return function _createSuperInternal() {
      var Super = _getPrototypeOf(Derived),
          result;

      if (hasNativeReflectConstruct) {
        var NewTarget = _getPrototypeOf(this).constructor;

        result = Reflect.construct(Super, arguments, NewTarget);
      } else {
        result = Super.apply(this, arguments);
      }

      return _possibleConstructorReturn(this, result);
    };
  }

  function _readOnlyError(name) {
    throw new TypeError("\"" + name + "\" is read-only");
  }

  function _unsupportedIterableToArray(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _arrayLikeToArray(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(o);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
  }

  function _arrayLikeToArray(arr, len) {
    if (len == null || len > arr.length) len = arr.length;

    for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];

    return arr2;
  }

  function _createForOfIteratorHelper(o, allowArrayLike) {
    var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];

    if (!it) {
      if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
        if (it) o = it;
        var i = 0;

        var F = function () {};

        return {
          s: F,
          n: function () {
            if (i >= o.length) return {
              done: true
            };
            return {
              done: false,
              value: o[i++]
            };
          },
          e: function (e) {
            throw e;
          },
          f: F
        };
      }

      throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
    }

    var normalCompletion = true,
        didErr = false,
        err;
    return {
      s: function () {
        it = it.call(o);
      },
      n: function () {
        var step = it.next();
        normalCompletion = step.done;
        return step;
      },
      e: function (e) {
        didErr = true;
        err = e;
      },
      f: function () {
        try {
          if (!normalCompletion && it.return != null) it.return();
        } finally {
          if (didErr) throw err;
        }
      }
    };
  }

  // 7.2.1 RequireObjectCoercible(argument)
  var _defined = function (it) {
    if (it == undefined) throw TypeError("Can't call method on  " + it);
    return it;
  };

  // 7.1.13 ToObject(argument)

  var _toObject = function (it) {
    return Object(_defined(it));
  };

  var hasOwnProperty = {}.hasOwnProperty;
  var _has = function (it, key) {
    return hasOwnProperty.call(it, key);
  };

  var toString = {}.toString;

  var _cof = function (it) {
    return toString.call(it).slice(8, -1);
  };

  // fallback for non-array-like ES3 and non-enumerable old V8 strings

  // eslint-disable-next-line no-prototype-builtins
  var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
    return _cof(it) == 'String' ? it.split('') : Object(it);
  };

  // to indexed object, toObject with fallback for non-array-like ES3 strings


  var _toIobject = function (it) {
    return _iobject(_defined(it));
  };

  // 7.1.4 ToInteger
  var ceil = Math.ceil;
  var floor = Math.floor;
  var _toInteger = function (it) {
    return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  };

  // 7.1.15 ToLength

  var min = Math.min;
  var _toLength = function (it) {
    return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  };

  var max = Math.max;
  var min$1 = Math.min;
  var _toAbsoluteIndex = function (index, length) {
    index = _toInteger(index);
    return index < 0 ? max(index + length, 0) : min$1(index, length);
  };

  // false -> Array#indexOf
  // true  -> Array#includes



  var _arrayIncludes = function (IS_INCLUDES) {
    return function ($this, el, fromIndex) {
      var O = _toIobject($this);
      var length = _toLength(O.length);
      var index = _toAbsoluteIndex(fromIndex, length);
      var value;
      // Array#includes uses SameValueZero equality algorithm
      // eslint-disable-next-line no-self-compare
      if (IS_INCLUDES && el != el) while (length > index) {
        value = O[index++];
        // eslint-disable-next-line no-self-compare
        if (value != value) return true;
      // Array#indexOf ignores holes, Array#includes - not
      } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
        if (O[index] === el) return IS_INCLUDES || index || 0;
      } return !IS_INCLUDES && -1;
    };
  };

  function createCommonjsModule(fn, module) {
  	return module = { exports: {} }, fn(module, module.exports), module.exports;
  }

  var _core = createCommonjsModule(function (module) {
  var core = module.exports = { version: '2.6.10' };
  if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  });
  var _core_1 = _core.version;

  var _global = createCommonjsModule(function (module) {
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  var global = module.exports = typeof window != 'undefined' && window.Math == Math
    ? window : typeof self != 'undefined' && self.Math == Math ? self
    // eslint-disable-next-line no-new-func
    : Function('return this')();
  if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  });

  var _library = true;

  var _shared = createCommonjsModule(function (module) {
  var SHARED = '__core-js_shared__';
  var store = _global[SHARED] || (_global[SHARED] = {});

  (module.exports = function (key, value) {
    return store[key] || (store[key] = value !== undefined ? value : {});
  })('versions', []).push({
    version: _core.version,
    mode:  'pure' ,
    copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  });
  });

  var id = 0;
  var px = Math.random();
  var _uid = function (key) {
    return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  };

  var shared = _shared('keys');

  var _sharedKey = function (key) {
    return shared[key] || (shared[key] = _uid(key));
  };

  var arrayIndexOf = _arrayIncludes(false);
  var IE_PROTO = _sharedKey('IE_PROTO');

  var _objectKeysInternal = function (object, names) {
    var O = _toIobject(object);
    var i = 0;
    var result = [];
    var key;
    for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
    // Don't enum bug & hidden keys
    while (names.length > i) if (_has(O, key = names[i++])) {
      ~arrayIndexOf(result, key) || result.push(key);
    }
    return result;
  };

  // IE 8- don't enum bug keys
  var _enumBugKeys = (
    'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
  ).split(',');

  // 19.1.2.14 / 15.2.3.14 Object.keys(O)



  var _objectKeys = Object.keys || function keys(O) {
    return _objectKeysInternal(O, _enumBugKeys);
  };

  var _aFunction = function (it) {
    if (typeof it != 'function') throw TypeError(it + ' is not a function!');
    return it;
  };

  // optional / simple context binding

  var _ctx = function (fn, that, length) {
    _aFunction(fn);
    if (that === undefined) return fn;
    switch (length) {
      case 1: return function (a) {
        return fn.call(that, a);
      };
      case 2: return function (a, b) {
        return fn.call(that, a, b);
      };
      case 3: return function (a, b, c) {
        return fn.call(that, a, b, c);
      };
    }
    return function (/* ...args */) {
      return fn.apply(that, arguments);
    };
  };

  var _isObject = function (it) {
    return typeof it === 'object' ? it !== null : typeof it === 'function';
  };

  var _anObject = function (it) {
    if (!_isObject(it)) throw TypeError(it + ' is not an object!');
    return it;
  };

  var _fails = function (exec) {
    try {
      return !!exec();
    } catch (e) {
      return true;
    }
  };

  // Thank's IE8 for his funny defineProperty
  var _descriptors = !_fails(function () {
    return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  });

  var document$1 = _global.document;
  // typeof document.createElement is 'object' in old IE
  var is = _isObject(document$1) && _isObject(document$1.createElement);
  var _domCreate = function (it) {
    return is ? document$1.createElement(it) : {};
  };

  var _ie8DomDefine = !_descriptors && !_fails(function () {
    return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
  });

  // 7.1.1 ToPrimitive(input [, PreferredType])

  // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  // and the second argument - flag - preferred type is a string
  var _toPrimitive = function (it, S) {
    if (!_isObject(it)) return it;
    var fn, val;
    if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
    if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
    if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
    throw TypeError("Can't convert object to primitive value");
  };

  var dP = Object.defineProperty;

  var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
    _anObject(O);
    P = _toPrimitive(P, true);
    _anObject(Attributes);
    if (_ie8DomDefine) try {
      return dP(O, P, Attributes);
    } catch (e) { /* empty */ }
    if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
    if ('value' in Attributes) O[P] = Attributes.value;
    return O;
  };

  var _objectDp = {
  	f: f
  };

  var _propertyDesc = function (bitmap, value) {
    return {
      enumerable: !(bitmap & 1),
      configurable: !(bitmap & 2),
      writable: !(bitmap & 4),
      value: value
    };
  };

  var _hide = _descriptors ? function (object, key, value) {
    return _objectDp.f(object, key, _propertyDesc(1, value));
  } : function (object, key, value) {
    object[key] = value;
    return object;
  };

  var PROTOTYPE = 'prototype';

  var $export = function (type, name, source) {
    var IS_FORCED = type & $export.F;
    var IS_GLOBAL = type & $export.G;
    var IS_STATIC = type & $export.S;
    var IS_PROTO = type & $export.P;
    var IS_BIND = type & $export.B;
    var IS_WRAP = type & $export.W;
    var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
    var expProto = exports[PROTOTYPE];
    var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE];
    var key, own, out;
    if (IS_GLOBAL) source = name;
    for (key in source) {
      // contains in native
      own = !IS_FORCED && target && target[key] !== undefined;
      if (own && _has(exports, key)) continue;
      // export native or passed
      out = own ? target[key] : source[key];
      // prevent global pollution for namespaces
      exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
      // bind timers to global for call from export context
      : IS_BIND && own ? _ctx(out, _global)
      // wrap global constructors for prevent change them in library
      : IS_WRAP && target[key] == out ? (function (C) {
        var F = function (a, b, c) {
          if (this instanceof C) {
            switch (arguments.length) {
              case 0: return new C();
              case 1: return new C(a);
              case 2: return new C(a, b);
            } return new C(a, b, c);
          } return C.apply(this, arguments);
        };
        F[PROTOTYPE] = C[PROTOTYPE];
        return F;
      // make static versions for prototype methods
      })(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
      // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
      if (IS_PROTO) {
        (exports.virtual || (exports.virtual = {}))[key] = out;
        // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
        if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out);
      }
    }
  };
  // type bitmap
  $export.F = 1;   // forced
  $export.G = 2;   // global
  $export.S = 4;   // static
  $export.P = 8;   // proto
  $export.B = 16;  // bind
  $export.W = 32;  // wrap
  $export.U = 64;  // safe
  $export.R = 128; // real proto method for `library`
  var _export = $export;

  // most Object methods by ES6 should accept primitives



  var _objectSap = function (KEY, exec) {
    var fn = (_core.Object || {})[KEY] || Object[KEY];
    var exp = {};
    exp[KEY] = exec(fn);
    _export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp);
  };

  // 19.1.2.14 Object.keys(O)



  _objectSap('keys', function () {
    return function keys(it) {
      return _objectKeys(_toObject(it));
    };
  });

  var keys = _core.Object.keys;

  var keys$1 = keys;

  var $JSON = _core.JSON || (_core.JSON = { stringify: JSON.stringify });
  var stringify = function stringify(it) { // eslint-disable-line no-unused-vars
    return $JSON.stringify.apply($JSON, arguments);
  };

  var stringify$1 = stringify;

  // true  -> String#at
  // false -> String#codePointAt
  var _stringAt = function (TO_STRING) {
    return function (that, pos) {
      var s = String(_defined(that));
      var i = _toInteger(pos);
      var l = s.length;
      var a, b;
      if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
      a = s.charCodeAt(i);
      return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
        ? TO_STRING ? s.charAt(i) : a
        : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
    };
  };

  var _redefine = _hide;

  var _iterators = {};

  var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
    _anObject(O);
    var keys = _objectKeys(Properties);
    var length = keys.length;
    var i = 0;
    var P;
    while (length > i) _objectDp.f(O, P = keys[i++], Properties[P]);
    return O;
  };

  var document$2 = _global.document;
  var _html = document$2 && document$2.documentElement;

  // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])



  var IE_PROTO$1 = _sharedKey('IE_PROTO');
  var Empty = function () { /* empty */ };
  var PROTOTYPE$1 = 'prototype';

  // Create object with fake `null` prototype: use iframe Object with cleared prototype
  var createDict = function () {
    // Thrash, waste and sodomy: IE GC bug
    var iframe = _domCreate('iframe');
    var i = _enumBugKeys.length;
    var lt = '<';
    var gt = '>';
    var iframeDocument;
    iframe.style.display = 'none';
    _html.appendChild(iframe);
    iframe.src = 'javascript:'; // eslint-disable-line no-script-url
    // createDict = iframe.contentWindow.Object;
    // html.removeChild(iframe);
    iframeDocument = iframe.contentWindow.document;
    iframeDocument.open();
    iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
    iframeDocument.close();
    createDict = iframeDocument.F;
    while (i--) delete createDict[PROTOTYPE$1][_enumBugKeys[i]];
    return createDict();
  };

  var _objectCreate = Object.create || function create(O, Properties) {
    var result;
    if (O !== null) {
      Empty[PROTOTYPE$1] = _anObject(O);
      result = new Empty();
      Empty[PROTOTYPE$1] = null;
      // add "__proto__" for Object.getPrototypeOf polyfill
      result[IE_PROTO$1] = O;
    } else result = createDict();
    return Properties === undefined ? result : _objectDps(result, Properties);
  };

  var _wks = createCommonjsModule(function (module) {
  var store = _shared('wks');

  var Symbol = _global.Symbol;
  var USE_SYMBOL = typeof Symbol == 'function';

  var $exports = module.exports = function (name) {
    return store[name] || (store[name] =
      USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid)('Symbol.' + name));
  };

  $exports.store = store;
  });

  var def = _objectDp.f;

  var TAG = _wks('toStringTag');

  var _setToStringTag = function (it, tag, stat) {
    if (it && !_has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
  };

  var IteratorPrototype = {};

  // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  _hide(IteratorPrototype, _wks('iterator'), function () { return this; });

  var _iterCreate = function (Constructor, NAME, next) {
    Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) });
    _setToStringTag(Constructor, NAME + ' Iterator');
  };

  // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)


  var IE_PROTO$2 = _sharedKey('IE_PROTO');
  var ObjectProto = Object.prototype;

  var _objectGpo = Object.getPrototypeOf || function (O) {
    O = _toObject(O);
    if (_has(O, IE_PROTO$2)) return O[IE_PROTO$2];
    if (typeof O.constructor == 'function' && O instanceof O.constructor) {
      return O.constructor.prototype;
    } return O instanceof Object ? ObjectProto : null;
  };

  var ITERATOR = _wks('iterator');
  var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
  var FF_ITERATOR = '@@iterator';
  var KEYS = 'keys';
  var VALUES = 'values';

  var returnThis = function () { return this; };

  var _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
    _iterCreate(Constructor, NAME, next);
    var getMethod = function (kind) {
      if (!BUGGY && kind in proto) return proto[kind];
      switch (kind) {
        case KEYS: return function keys() { return new Constructor(this, kind); };
        case VALUES: return function values() { return new Constructor(this, kind); };
      } return function entries() { return new Constructor(this, kind); };
    };
    var TAG = NAME + ' Iterator';
    var DEF_VALUES = DEFAULT == VALUES;
    var VALUES_BUG = false;
    var proto = Base.prototype;
    var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
    var $default = $native || getMethod(DEFAULT);
    var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
    var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
    var methods, key, IteratorPrototype;
    // Fix native
    if ($anyNative) {
      IteratorPrototype = _objectGpo($anyNative.call(new Base()));
      if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
        // Set @@toStringTag to native iterators
        _setToStringTag(IteratorPrototype, TAG, true);
      }
    }
    // fix Array#{values, @@iterator}.name in V8 / FF
    if (DEF_VALUES && $native && $native.name !== VALUES) {
      VALUES_BUG = true;
      $default = function values() { return $native.call(this); };
    }
    // Define iterator
    if (( FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
      _hide(proto, ITERATOR, $default);
    }
    // Plug for library
    _iterators[NAME] = $default;
    _iterators[TAG] = returnThis;
    if (DEFAULT) {
      methods = {
        values: DEF_VALUES ? $default : getMethod(VALUES),
        keys: IS_SET ? $default : getMethod(KEYS),
        entries: $entries
      };
      if (FORCED) for (key in methods) {
        if (!(key in proto)) _redefine(proto, key, methods[key]);
      } else _export(_export.P + _export.F * (BUGGY || VALUES_BUG), NAME, methods);
    }
    return methods;
  };

  var $at = _stringAt(true);

  // 21.1.3.27 String.prototype[@@iterator]()
  _iterDefine(String, 'String', function (iterated) {
    this._t = String(iterated); // target
    this._i = 0;                // next index
  // 21.1.5.2.1 %StringIteratorPrototype%.next()
  }, function () {
    var O = this._t;
    var index = this._i;
    var point;
    if (index >= O.length) return { value: undefined, done: true };
    point = $at(O, index);
    this._i += point.length;
    return { value: point, done: false };
  });

  var _iterStep = function (done, value) {
    return { value: value, done: !!done };
  };

  // 22.1.3.4 Array.prototype.entries()
  // 22.1.3.13 Array.prototype.keys()
  // 22.1.3.29 Array.prototype.values()
  // 22.1.3.30 Array.prototype[@@iterator]()
  var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) {
    this._t = _toIobject(iterated); // target
    this._i = 0;                   // next index
    this._k = kind;                // kind
  // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  }, function () {
    var O = this._t;
    var kind = this._k;
    var index = this._i++;
    if (!O || index >= O.length) {
      this._t = undefined;
      return _iterStep(1);
    }
    if (kind == 'keys') return _iterStep(0, index);
    if (kind == 'values') return _iterStep(0, O[index]);
    return _iterStep(0, [index, O[index]]);
  }, 'values');

  // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  _iterators.Arguments = _iterators.Array;

  var TO_STRING_TAG = _wks('toStringTag');

  var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
    'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
    'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
    'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
    'TextTrackList,TouchList').split(',');

  for (var i = 0; i < DOMIterables.length; i++) {
    var NAME = DOMIterables[i];
    var Collection = _global[NAME];
    var proto = Collection && Collection.prototype;
    if (proto && !proto[TO_STRING_TAG]) _hide(proto, TO_STRING_TAG, NAME);
    _iterators[NAME] = _iterators.Array;
  }

  // getting tag from 19.1.3.6 Object.prototype.toString()

  var TAG$1 = _wks('toStringTag');
  // ES3 wrong here
  var ARG = _cof(function () { return arguments; }()) == 'Arguments';

  // fallback for IE11 Script Access Denied error
  var tryGet = function (it, key) {
    try {
      return it[key];
    } catch (e) { /* empty */ }
  };

  var _classof = function (it) {
    var O, T, B;
    return it === undefined ? 'Undefined' : it === null ? 'Null'
      // @@toStringTag case
      : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T
      // builtinTag case
      : ARG ? _cof(O)
      // ES3 arguments fallback
      : (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  };

  var _anInstance = function (it, Constructor, name, forbiddenField) {
    if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
      throw TypeError(name + ': incorrect invocation!');
    } return it;
  };

  // call something on iterator step with safe closing on error

  var _iterCall = function (iterator, fn, value, entries) {
    try {
      return entries ? fn(_anObject(value)[0], value[1]) : fn(value);
    // 7.4.6 IteratorClose(iterator, completion)
    } catch (e) {
      var ret = iterator['return'];
      if (ret !== undefined) _anObject(ret.call(iterator));
      throw e;
    }
  };

  // check on default Array iterator

  var ITERATOR$1 = _wks('iterator');
  var ArrayProto = Array.prototype;

  var _isArrayIter = function (it) {
    return it !== undefined && (_iterators.Array === it || ArrayProto[ITERATOR$1] === it);
  };

  var ITERATOR$2 = _wks('iterator');

  var core_getIteratorMethod = _core.getIteratorMethod = function (it) {
    if (it != undefined) return it[ITERATOR$2]
      || it['@@iterator']
      || _iterators[_classof(it)];
  };

  var _forOf = createCommonjsModule(function (module) {
  var BREAK = {};
  var RETURN = {};
  var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
    var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod(iterable);
    var f = _ctx(fn, that, entries ? 2 : 1);
    var index = 0;
    var length, step, iterator, result;
    if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
    // fast case for arrays with default iterator
    if (_isArrayIter(iterFn)) for (length = _toLength(iterable.length); length > index; index++) {
      result = entries ? f(_anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
      if (result === BREAK || result === RETURN) return result;
    } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
      result = _iterCall(iterator, f, step.value, entries);
      if (result === BREAK || result === RETURN) return result;
    }
  };
  exports.BREAK = BREAK;
  exports.RETURN = RETURN;
  });

  // 7.3.20 SpeciesConstructor(O, defaultConstructor)


  var SPECIES = _wks('species');
  var _speciesConstructor = function (O, D) {
    var C = _anObject(O).constructor;
    var S;
    return C === undefined || (S = _anObject(C)[SPECIES]) == undefined ? D : _aFunction(S);
  };

  // fast apply, http://jsperf.lnkit.com/fast-apply/5
  var _invoke = function (fn, args, that) {
    var un = that === undefined;
    switch (args.length) {
      case 0: return un ? fn()
                        : fn.call(that);
      case 1: return un ? fn(args[0])
                        : fn.call(that, args[0]);
      case 2: return un ? fn(args[0], args[1])
                        : fn.call(that, args[0], args[1]);
      case 3: return un ? fn(args[0], args[1], args[2])
                        : fn.call(that, args[0], args[1], args[2]);
      case 4: return un ? fn(args[0], args[1], args[2], args[3])
                        : fn.call(that, args[0], args[1], args[2], args[3]);
    } return fn.apply(that, args);
  };

  var process = _global.process;
  var setTask = _global.setImmediate;
  var clearTask = _global.clearImmediate;
  var MessageChannel = _global.MessageChannel;
  var Dispatch = _global.Dispatch;
  var counter = 0;
  var queue = {};
  var ONREADYSTATECHANGE = 'onreadystatechange';
  var defer, channel, port;
  var run = function () {
    var id = +this;
    // eslint-disable-next-line no-prototype-builtins
    if (queue.hasOwnProperty(id)) {
      var fn = queue[id];
      delete queue[id];
      fn();
    }
  };
  var listener = function (event) {
    run.call(event.data);
  };
  // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  if (!setTask || !clearTask) {
    setTask = function setImmediate(fn) {
      var args = [];
      var i = 1;
      while (arguments.length > i) args.push(arguments[i++]);
      queue[++counter] = function () {
        // eslint-disable-next-line no-new-func
        _invoke(typeof fn == 'function' ? fn : Function(fn), args);
      };
      defer(counter);
      return counter;
    };
    clearTask = function clearImmediate(id) {
      delete queue[id];
    };
    // Node.js 0.8-
    if (_cof(process) == 'process') {
      defer = function (id) {
        process.nextTick(_ctx(run, id, 1));
      };
    // Sphere (JS game engine) Dispatch API
    } else if (Dispatch && Dispatch.now) {
      defer = function (id) {
        Dispatch.now(_ctx(run, id, 1));
      };
    // Browsers with MessageChannel, includes WebWorkers
    } else if (MessageChannel) {
      channel = new MessageChannel();
      port = channel.port2;
      channel.port1.onmessage = listener;
      defer = _ctx(port.postMessage, port, 1);
    // Browsers with postMessage, skip WebWorkers
    // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
    } else if (_global.addEventListener && typeof postMessage == 'function' && !_global.importScripts) {
      defer = function (id) {
        _global.postMessage(id + '', '*');
      };
      _global.addEventListener('message', listener, false);
    // IE8-
    } else if (ONREADYSTATECHANGE in _domCreate('script')) {
      defer = function (id) {
        _html.appendChild(_domCreate('script'))[ONREADYSTATECHANGE] = function () {
          _html.removeChild(this);
          run.call(id);
        };
      };
    // Rest old browsers
    } else {
      defer = function (id) {
        setTimeout(_ctx(run, id, 1), 0);
      };
    }
  }
  var _task = {
    set: setTask,
    clear: clearTask
  };

  var macrotask = _task.set;
  var Observer = _global.MutationObserver || _global.WebKitMutationObserver;
  var process$1 = _global.process;
  var Promise = _global.Promise;
  var isNode = _cof(process$1) == 'process';

  var _microtask = function () {
    var head, last, notify;

    var flush = function () {
      var parent, fn;
      if (isNode && (parent = process$1.domain)) parent.exit();
      while (head) {
        fn = head.fn;
        head = head.next;
        try {
          fn();
        } catch (e) {
          if (head) notify();
          else last = undefined;
          throw e;
        }
      } last = undefined;
      if (parent) parent.enter();
    };

    // Node.js
    if (isNode) {
      notify = function () {
        process$1.nextTick(flush);
      };
    // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
    } else if (Observer && !(_global.navigator && _global.navigator.standalone)) {
      var toggle = true;
      var node = document.createTextNode('');
      new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
      notify = function () {
        node.data = toggle = !toggle;
      };
    // environments with maybe non-completely correct, but existent Promise
    } else if (Promise && Promise.resolve) {
      // Promise.resolve without an argument throws an error in LG WebOS 2
      var promise = Promise.resolve(undefined);
      notify = function () {
        promise.then(flush);
      };
    // for other environments - macrotask based on:
    // - setImmediate
    // - MessageChannel
    // - window.postMessag
    // - onreadystatechange
    // - setTimeout
    } else {
      notify = function () {
        // strange IE + webpack dev server bug - use .call(global)
        macrotask.call(_global, flush);
      };
    }

    return function (fn) {
      var task = { fn: fn, next: undefined };
      if (last) last.next = task;
      if (!head) {
        head = task;
        notify();
      } last = task;
    };
  };

  // 25.4.1.5 NewPromiseCapability(C)


  function PromiseCapability(C) {
    var resolve, reject;
    this.promise = new C(function ($$resolve, $$reject) {
      if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
      resolve = $$resolve;
      reject = $$reject;
    });
    this.resolve = _aFunction(resolve);
    this.reject = _aFunction(reject);
  }

  var f$1 = function (C) {
    return new PromiseCapability(C);
  };

  var _newPromiseCapability = {
  	f: f$1
  };

  var _perform = function (exec) {
    try {
      return { e: false, v: exec() };
    } catch (e) {
      return { e: true, v: e };
    }
  };

  var navigator$1 = _global.navigator;

  var _userAgent = navigator$1 && navigator$1.userAgent || '';

  var _promiseResolve = function (C, x) {
    _anObject(C);
    if (_isObject(x) && x.constructor === C) return x;
    var promiseCapability = _newPromiseCapability.f(C);
    var resolve = promiseCapability.resolve;
    resolve(x);
    return promiseCapability.promise;
  };

  var _redefineAll = function (target, src, safe) {
    for (var key in src) {
      if (safe && target[key]) target[key] = src[key];
      else _hide(target, key, src[key]);
    } return target;
  };

  var SPECIES$1 = _wks('species');

  var _setSpecies = function (KEY) {
    var C = typeof _core[KEY] == 'function' ? _core[KEY] : _global[KEY];
    if (_descriptors && C && !C[SPECIES$1]) _objectDp.f(C, SPECIES$1, {
      configurable: true,
      get: function () { return this; }
    });
  };

  var ITERATOR$3 = _wks('iterator');
  var SAFE_CLOSING = false;

  try {
    var riter = [7][ITERATOR$3]();
    riter['return'] = function () { SAFE_CLOSING = true; };
    // eslint-disable-next-line no-throw-literal
    Array.from(riter, function () { throw 2; });
  } catch (e) { /* empty */ }

  var _iterDetect = function (exec, skipClosing) {
    if (!skipClosing && !SAFE_CLOSING) return false;
    var safe = false;
    try {
      var arr = [7];
      var iter = arr[ITERATOR$3]();
      iter.next = function () { return { done: safe = true }; };
      arr[ITERATOR$3] = function () { return iter; };
      exec(arr);
    } catch (e) { /* empty */ }
    return safe;
  };

  var task = _task.set;
  var microtask = _microtask();




  var PROMISE = 'Promise';
  var TypeError$1 = _global.TypeError;
  var process$2 = _global.process;
  var versions = process$2 && process$2.versions;
  var v8 = versions && versions.v8 || '';
  var $Promise = _global[PROMISE];
  var isNode$1 = _classof(process$2) == 'process';
  var empty = function () { /* empty */ };
  var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
  var newPromiseCapability = newGenericPromiseCapability = _newPromiseCapability.f;

  var USE_NATIVE = !!function () {
    try {
      // correct subclassing with @@species support
      var promise = $Promise.resolve(1);
      var FakePromise = (promise.constructor = {})[_wks('species')] = function (exec) {
        exec(empty, empty);
      };
      // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
      return (isNode$1 || typeof PromiseRejectionEvent == 'function')
        && promise.then(empty) instanceof FakePromise
        // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
        // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
        // we can't detect it synchronously, so just check versions
        && v8.indexOf('6.6') !== 0
        && _userAgent.indexOf('Chrome/66') === -1;
    } catch (e) { /* empty */ }
  }();

  // helpers
  var isThenable = function (it) {
    var then;
    return _isObject(it) && typeof (then = it.then) == 'function' ? then : false;
  };
  var notify = function (promise, isReject) {
    if (promise._n) return;
    promise._n = true;
    var chain = promise._c;
    microtask(function () {
      var value = promise._v;
      var ok = promise._s == 1;
      var i = 0;
      var run = function (reaction) {
        var handler = ok ? reaction.ok : reaction.fail;
        var resolve = reaction.resolve;
        var reject = reaction.reject;
        var domain = reaction.domain;
        var result, then, exited;
        try {
          if (handler) {
            if (!ok) {
              if (promise._h == 2) onHandleUnhandled(promise);
              promise._h = 1;
            }
            if (handler === true) result = value;
            else {
              if (domain) domain.enter();
              result = handler(value); // may throw
              if (domain) {
                domain.exit();
                exited = true;
              }
            }
            if (result === reaction.promise) {
              reject(TypeError$1('Promise-chain cycle'));
            } else if (then = isThenable(result)) {
              then.call(result, resolve, reject);
            } else resolve(result);
          } else reject(value);
        } catch (e) {
          if (domain && !exited) domain.exit();
          reject(e);
        }
      };
      while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
      promise._c = [];
      promise._n = false;
      if (isReject && !promise._h) onUnhandled(promise);
    });
  };
  var onUnhandled = function (promise) {
    task.call(_global, function () {
      var value = promise._v;
      var unhandled = isUnhandled(promise);
      var result, handler, console;
      if (unhandled) {
        result = _perform(function () {
          if (isNode$1) {
            process$2.emit('unhandledRejection', value, promise);
          } else if (handler = _global.onunhandledrejection) {
            handler({ promise: promise, reason: value });
          } else if ((console = _global.console) && console.error) {
            console.error('Unhandled promise rejection', value);
          }
        });
        // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
        promise._h = isNode$1 || isUnhandled(promise) ? 2 : 1;
      } promise._a = undefined;
      if (unhandled && result.e) throw result.v;
    });
  };
  var isUnhandled = function (promise) {
    return promise._h !== 1 && (promise._a || promise._c).length === 0;
  };
  var onHandleUnhandled = function (promise) {
    task.call(_global, function () {
      var handler;
      if (isNode$1) {
        process$2.emit('rejectionHandled', promise);
      } else if (handler = _global.onrejectionhandled) {
        handler({ promise: promise, reason: promise._v });
      }
    });
  };
  var $reject = function (value) {
    var promise = this;
    if (promise._d) return;
    promise._d = true;
    promise = promise._w || promise; // unwrap
    promise._v = value;
    promise._s = 2;
    if (!promise._a) promise._a = promise._c.slice();
    notify(promise, true);
  };
  var $resolve = function (value) {
    var promise = this;
    var then;
    if (promise._d) return;
    promise._d = true;
    promise = promise._w || promise; // unwrap
    try {
      if (promise === value) throw TypeError$1("Promise can't be resolved itself");
      if (then = isThenable(value)) {
        microtask(function () {
          var wrapper = { _w: promise, _d: false }; // wrap
          try {
            then.call(value, _ctx($resolve, wrapper, 1), _ctx($reject, wrapper, 1));
          } catch (e) {
            $reject.call(wrapper, e);
          }
        });
      } else {
        promise._v = value;
        promise._s = 1;
        notify(promise, false);
      }
    } catch (e) {
      $reject.call({ _w: promise, _d: false }, e); // wrap
    }
  };

  // constructor polyfill
  if (!USE_NATIVE) {
    // 25.4.3.1 Promise(executor)
    $Promise = function Promise(executor) {
      _anInstance(this, $Promise, PROMISE, '_h');
      _aFunction(executor);
      Internal.call(this);
      try {
        executor(_ctx($resolve, this, 1), _ctx($reject, this, 1));
      } catch (err) {
        $reject.call(this, err);
      }
    };
    // eslint-disable-next-line no-unused-vars
    Internal = function Promise(executor) {
      this._c = [];             // <- awaiting reactions
      this._a = undefined;      // <- checked in isUnhandled reactions
      this._s = 0;              // <- state
      this._d = false;          // <- done
      this._v = undefined;      // <- value
      this._h = 0;              // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
      this._n = false;          // <- notify
    };
    Internal.prototype = _redefineAll($Promise.prototype, {
      // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
      then: function then(onFulfilled, onRejected) {
        var reaction = newPromiseCapability(_speciesConstructor(this, $Promise));
        reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
        reaction.fail = typeof onRejected == 'function' && onRejected;
        reaction.domain = isNode$1 ? process$2.domain : undefined;
        this._c.push(reaction);
        if (this._a) this._a.push(reaction);
        if (this._s) notify(this, false);
        return reaction.promise;
      },
      // 25.4.5.1 Promise.prototype.catch(onRejected)
      'catch': function (onRejected) {
        return this.then(undefined, onRejected);
      }
    });
    OwnPromiseCapability = function () {
      var promise = new Internal();
      this.promise = promise;
      this.resolve = _ctx($resolve, promise, 1);
      this.reject = _ctx($reject, promise, 1);
    };
    _newPromiseCapability.f = newPromiseCapability = function (C) {
      return C === $Promise || C === Wrapper
        ? new OwnPromiseCapability(C)
        : newGenericPromiseCapability(C);
    };
  }

  _export(_export.G + _export.W + _export.F * !USE_NATIVE, { Promise: $Promise });
  _setToStringTag($Promise, PROMISE);
  _setSpecies(PROMISE);
  Wrapper = _core[PROMISE];

  // statics
  _export(_export.S + _export.F * !USE_NATIVE, PROMISE, {
    // 25.4.4.5 Promise.reject(r)
    reject: function reject(r) {
      var capability = newPromiseCapability(this);
      var $$reject = capability.reject;
      $$reject(r);
      return capability.promise;
    }
  });
  _export(_export.S + _export.F * (_library ), PROMISE, {
    // 25.4.4.6 Promise.resolve(x)
    resolve: function resolve(x) {
      return _promiseResolve( this === Wrapper ? $Promise : this, x);
    }
  });
  _export(_export.S + _export.F * !(USE_NATIVE && _iterDetect(function (iter) {
    $Promise.all(iter)['catch'](empty);
  })), PROMISE, {
    // 25.4.4.1 Promise.all(iterable)
    all: function all(iterable) {
      var C = this;
      var capability = newPromiseCapability(C);
      var resolve = capability.resolve;
      var reject = capability.reject;
      var result = _perform(function () {
        var values = [];
        var index = 0;
        var remaining = 1;
        _forOf(iterable, false, function (promise) {
          var $index = index++;
          var alreadyCalled = false;
          values.push(undefined);
          remaining++;
          C.resolve(promise).then(function (value) {
            if (alreadyCalled) return;
            alreadyCalled = true;
            values[$index] = value;
            --remaining || resolve(values);
          }, reject);
        });
        --remaining || resolve(values);
      });
      if (result.e) reject(result.v);
      return capability.promise;
    },
    // 25.4.4.4 Promise.race(iterable)
    race: function race(iterable) {
      var C = this;
      var capability = newPromiseCapability(C);
      var reject = capability.reject;
      var result = _perform(function () {
        _forOf(iterable, false, function (promise) {
          C.resolve(promise).then(capability.resolve, reject);
        });
      });
      if (result.e) reject(result.v);
      return capability.promise;
    }
  });

  _export(_export.P + _export.R, 'Promise', { 'finally': function (onFinally) {
    var C = _speciesConstructor(this, _core.Promise || _global.Promise);
    var isFunction = typeof onFinally == 'function';
    return this.then(
      isFunction ? function (x) {
        return _promiseResolve(C, onFinally()).then(function () { return x; });
      } : onFinally,
      isFunction ? function (e) {
        return _promiseResolve(C, onFinally()).then(function () { throw e; });
      } : onFinally
    );
  } });

  // https://github.com/tc39/proposal-promise-try




  _export(_export.S, 'Promise', { 'try': function (callbackfn) {
    var promiseCapability = _newPromiseCapability.f(this);
    var result = _perform(callbackfn);
    (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
    return promiseCapability.promise;
  } });

  var promise = _core.Promise;

  var promise$1 = promise;

  var _stringWs = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
    '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';

  var space = '[' + _stringWs + ']';
  var non = '\u200b\u0085';
  var ltrim = RegExp('^' + space + space + '*');
  var rtrim = RegExp(space + space + '*$');

  var exporter = function (KEY, exec, ALIAS) {
    var exp = {};
    var FORCE = _fails(function () {
      return !!_stringWs[KEY]() || non[KEY]() != non;
    });
    var fn = exp[KEY] = FORCE ? exec(trim) : _stringWs[KEY];
    if (ALIAS) exp[ALIAS] = fn;
    _export(_export.P + _export.F * FORCE, 'String', exp);
  };

  // 1 -> String#trimLeft
  // 2 -> String#trimRight
  // 3 -> String#trim
  var trim = exporter.trim = function (string, TYPE) {
    string = String(_defined(string));
    if (TYPE & 1) string = string.replace(ltrim, '');
    if (TYPE & 2) string = string.replace(rtrim, '');
    return string;
  };

  var _stringTrim = exporter;

  var $parseInt = _global.parseInt;
  var $trim = _stringTrim.trim;

  var hex = /^[-+]?0[xX]/;

  var _parseInt = $parseInt(_stringWs + '08') !== 8 || $parseInt(_stringWs + '0x16') !== 22 ? function parseInt(str, radix) {
    var string = $trim(String(str), 3);
    return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
  } : $parseInt;

  // 18.2.5 parseInt(string, radix)
  _export(_export.G + _export.F * (parseInt != _parseInt), { parseInt: _parseInt });

  var _parseInt$1 = _core.parseInt;

  var _parseInt$2 = _parseInt$1;

  var _isObject$1 = function (it) {
    return typeof it === 'object' ? it !== null : typeof it === 'function';
  };

  var _anObject$1 = function (it) {
    if (!_isObject$1(it)) throw TypeError(it + ' is not an object!');
    return it;
  };

  // 7.2.1 RequireObjectCoercible(argument)
  var _defined$1 = function (it) {
    if (it == undefined) throw TypeError("Can't call method on  " + it);
    return it;
  };

  // 7.1.13 ToObject(argument)

  var _toObject$1 = function (it) {
    return Object(_defined$1(it));
  };

  // 7.1.4 ToInteger
  var ceil$1 = Math.ceil;
  var floor$1 = Math.floor;
  var _toInteger$1 = function (it) {
    return isNaN(it = +it) ? 0 : (it > 0 ? floor$1 : ceil$1)(it);
  };

  // 7.1.15 ToLength

  var min$2 = Math.min;
  var _toLength$1 = function (it) {
    return it > 0 ? min$2(_toInteger$1(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  };

  // true  -> String#at
  // false -> String#codePointAt
  var _stringAt$1 = function (TO_STRING) {
    return function (that, pos) {
      var s = String(_defined$1(that));
      var i = _toInteger$1(pos);
      var l = s.length;
      var a, b;
      if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
      a = s.charCodeAt(i);
      return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
        ? TO_STRING ? s.charAt(i) : a
        : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
    };
  };

  var at = _stringAt$1(true);

   // `AdvanceStringIndex` abstract operation
  // https://tc39.github.io/ecma262/#sec-advancestringindex
  var _advanceStringIndex = function (S, index, unicode) {
    return index + (unicode ? at(S, index).length : 1);
  };

  var toString$1 = {}.toString;

  var _cof$1 = function (it) {
    return toString$1.call(it).slice(8, -1);
  };

  var _core$1 = createCommonjsModule(function (module) {
  var core = module.exports = { version: '2.6.10' };
  if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
  });
  var _core_1$1 = _core$1.version;

  var _global$1 = createCommonjsModule(function (module) {
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  var global = module.exports = typeof window != 'undefined' && window.Math == Math
    ? window : typeof self != 'undefined' && self.Math == Math ? self
    // eslint-disable-next-line no-new-func
    : Function('return this')();
  if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
  });

  var _shared$1 = createCommonjsModule(function (module) {
  var SHARED = '__core-js_shared__';
  var store = _global$1[SHARED] || (_global$1[SHARED] = {});

  (module.exports = function (key, value) {
    return store[key] || (store[key] = value !== undefined ? value : {});
  })('versions', []).push({
    version: _core$1.version,
    mode:  'global',
    copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
  });
  });

  var id$1 = 0;
  var px$1 = Math.random();
  var _uid$1 = function (key) {
    return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id$1 + px$1).toString(36));
  };

  var _wks$1 = createCommonjsModule(function (module) {
  var store = _shared$1('wks');

  var Symbol = _global$1.Symbol;
  var USE_SYMBOL = typeof Symbol == 'function';

  var $exports = module.exports = function (name) {
    return store[name] || (store[name] =
      USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid$1)('Symbol.' + name));
  };

  $exports.store = store;
  });

  // getting tag from 19.1.3.6 Object.prototype.toString()

  var TAG$2 = _wks$1('toStringTag');
  // ES3 wrong here
  var ARG$1 = _cof$1(function () { return arguments; }()) == 'Arguments';

  // fallback for IE11 Script Access Denied error
  var tryGet$1 = function (it, key) {
    try {
      return it[key];
    } catch (e) { /* empty */ }
  };

  var _classof$1 = function (it) {
    var O, T, B;
    return it === undefined ? 'Undefined' : it === null ? 'Null'
      // @@toStringTag case
      : typeof (T = tryGet$1(O = Object(it), TAG$2)) == 'string' ? T
      // builtinTag case
      : ARG$1 ? _cof$1(O)
      // ES3 arguments fallback
      : (B = _cof$1(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  };

  var builtinExec = RegExp.prototype.exec;

   // `RegExpExec` abstract operation
  // https://tc39.github.io/ecma262/#sec-regexpexec
  var _regexpExecAbstract = function (R, S) {
    var exec = R.exec;
    if (typeof exec === 'function') {
      var result = exec.call(R, S);
      if (typeof result !== 'object') {
        throw new TypeError('RegExp exec method returned something other than an Object or null');
      }
      return result;
    }
    if (_classof$1(R) !== 'RegExp') {
      throw new TypeError('RegExp#exec called on incompatible receiver');
    }
    return builtinExec.call(R, S);
  };

  // 21.2.5.3 get RegExp.prototype.flags

  var _flags = function () {
    var that = _anObject$1(this);
    var result = '';
    if (that.global) result += 'g';
    if (that.ignoreCase) result += 'i';
    if (that.multiline) result += 'm';
    if (that.unicode) result += 'u';
    if (that.sticky) result += 'y';
    return result;
  };

  var nativeExec = RegExp.prototype.exec;
  // This always refers to the native implementation, because the
  // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
  // which loads this file before patching the method.
  var nativeReplace = String.prototype.replace;

  var patchedExec = nativeExec;

  var LAST_INDEX = 'lastIndex';

  var UPDATES_LAST_INDEX_WRONG = (function () {
    var re1 = /a/,
        re2 = /b*/g;
    nativeExec.call(re1, 'a');
    nativeExec.call(re2, 'a');
    return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
  })();

  // nonparticipating capturing group, copied from es5-shim's String#split patch.
  var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;

  var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;

  if (PATCH) {
    patchedExec = function exec(str) {
      var re = this;
      var lastIndex, reCopy, match, i;

      if (NPCG_INCLUDED) {
        reCopy = new RegExp('^' + re.source + '$(?!\\s)', _flags.call(re));
      }
      if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];

      match = nativeExec.call(re, str);

      if (UPDATES_LAST_INDEX_WRONG && match) {
        re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;
      }
      if (NPCG_INCLUDED && match && match.length > 1) {
        // Fix browsers whose `exec` methods don't consistently return `undefined`
        // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
        // eslint-disable-next-line no-loop-func
        nativeReplace.call(match[0], reCopy, function () {
          for (i = 1; i < arguments.length - 2; i++) {
            if (arguments[i] === undefined) match[i] = undefined;
          }
        });
      }

      return match;
    };
  }

  var _regexpExec = patchedExec;

  var _fails$1 = function (exec) {
    try {
      return !!exec();
    } catch (e) {
      return true;
    }
  };

  // Thank's IE8 for his funny defineProperty
  var _descriptors$1 = !_fails$1(function () {
    return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
  });

  var document$3 = _global$1.document;
  // typeof document.createElement is 'object' in old IE
  var is$1 = _isObject$1(document$3) && _isObject$1(document$3.createElement);
  var _domCreate$1 = function (it) {
    return is$1 ? document$3.createElement(it) : {};
  };

  var _ie8DomDefine$1 = !_descriptors$1 && !_fails$1(function () {
    return Object.defineProperty(_domCreate$1('div'), 'a', { get: function () { return 7; } }).a != 7;
  });

  // 7.1.1 ToPrimitive(input [, PreferredType])

  // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  // and the second argument - flag - preferred type is a string
  var _toPrimitive$1 = function (it, S) {
    if (!_isObject$1(it)) return it;
    var fn, val;
    if (S && typeof (fn = it.toString) == 'function' && !_isObject$1(val = fn.call(it))) return val;
    if (typeof (fn = it.valueOf) == 'function' && !_isObject$1(val = fn.call(it))) return val;
    if (!S && typeof (fn = it.toString) == 'function' && !_isObject$1(val = fn.call(it))) return val;
    throw TypeError("Can't convert object to primitive value");
  };

  var dP$1 = Object.defineProperty;

  var f$2 = _descriptors$1 ? Object.defineProperty : function defineProperty(O, P, Attributes) {
    _anObject$1(O);
    P = _toPrimitive$1(P, true);
    _anObject$1(Attributes);
    if (_ie8DomDefine$1) try {
      return dP$1(O, P, Attributes);
    } catch (e) { /* empty */ }
    if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
    if ('value' in Attributes) O[P] = Attributes.value;
    return O;
  };

  var _objectDp$1 = {
  	f: f$2
  };

  var _propertyDesc$1 = function (bitmap, value) {
    return {
      enumerable: !(bitmap & 1),
      configurable: !(bitmap & 2),
      writable: !(bitmap & 4),
      value: value
    };
  };

  var _hide$1 = _descriptors$1 ? function (object, key, value) {
    return _objectDp$1.f(object, key, _propertyDesc$1(1, value));
  } : function (object, key, value) {
    object[key] = value;
    return object;
  };

  var hasOwnProperty$1 = {}.hasOwnProperty;
  var _has$1 = function (it, key) {
    return hasOwnProperty$1.call(it, key);
  };

  var _functionToString = _shared$1('native-function-to-string', Function.toString);

  var _redefine$1 = createCommonjsModule(function (module) {
  var SRC = _uid$1('src');

  var TO_STRING = 'toString';
  var TPL = ('' + _functionToString).split(TO_STRING);

  _core$1.inspectSource = function (it) {
    return _functionToString.call(it);
  };

  (module.exports = function (O, key, val, safe) {
    var isFunction = typeof val == 'function';
    if (isFunction) _has$1(val, 'name') || _hide$1(val, 'name', key);
    if (O[key] === val) return;
    if (isFunction) _has$1(val, SRC) || _hide$1(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
    if (O === _global$1) {
      O[key] = val;
    } else if (!safe) {
      delete O[key];
      _hide$1(O, key, val);
    } else if (O[key]) {
      O[key] = val;
    } else {
      _hide$1(O, key, val);
    }
  // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
  })(Function.prototype, TO_STRING, function toString() {
    return typeof this == 'function' && this[SRC] || _functionToString.call(this);
  });
  });

  var _aFunction$1 = function (it) {
    if (typeof it != 'function') throw TypeError(it + ' is not a function!');
    return it;
  };

  // optional / simple context binding

  var _ctx$1 = function (fn, that, length) {
    _aFunction$1(fn);
    if (that === undefined) return fn;
    switch (length) {
      case 1: return function (a) {
        return fn.call(that, a);
      };
      case 2: return function (a, b) {
        return fn.call(that, a, b);
      };
      case 3: return function (a, b, c) {
        return fn.call(that, a, b, c);
      };
    }
    return function (/* ...args */) {
      return fn.apply(that, arguments);
    };
  };

  var PROTOTYPE$2 = 'prototype';

  var $export$1 = function (type, name, source) {
    var IS_FORCED = type & $export$1.F;
    var IS_GLOBAL = type & $export$1.G;
    var IS_STATIC = type & $export$1.S;
    var IS_PROTO = type & $export$1.P;
    var IS_BIND = type & $export$1.B;
    var target = IS_GLOBAL ? _global$1 : IS_STATIC ? _global$1[name] || (_global$1[name] = {}) : (_global$1[name] || {})[PROTOTYPE$2];
    var exports = IS_GLOBAL ? _core$1 : _core$1[name] || (_core$1[name] = {});
    var expProto = exports[PROTOTYPE$2] || (exports[PROTOTYPE$2] = {});
    var key, own, out, exp;
    if (IS_GLOBAL) source = name;
    for (key in source) {
      // contains in native
      own = !IS_FORCED && target && target[key] !== undefined;
      // export native or passed
      out = (own ? target : source)[key];
      // bind timers to global for call from export context
      exp = IS_BIND && own ? _ctx$1(out, _global$1) : IS_PROTO && typeof out == 'function' ? _ctx$1(Function.call, out) : out;
      // extend global
      if (target) _redefine$1(target, key, out, type & $export$1.U);
      // export
      if (exports[key] != out) _hide$1(exports, key, exp);
      if (IS_PROTO && expProto[key] != out) expProto[key] = out;
    }
  };
  _global$1.core = _core$1;
  // type bitmap
  $export$1.F = 1;   // forced
  $export$1.G = 2;   // global
  $export$1.S = 4;   // static
  $export$1.P = 8;   // proto
  $export$1.B = 16;  // bind
  $export$1.W = 32;  // wrap
  $export$1.U = 64;  // safe
  $export$1.R = 128; // real proto method for `library`
  var _export$1 = $export$1;

  _export$1({
    target: 'RegExp',
    proto: true,
    forced: _regexpExec !== /./.exec
  }, {
    exec: _regexpExec
  });

  var SPECIES$2 = _wks$1('species');

  var REPLACE_SUPPORTS_NAMED_GROUPS = !_fails$1(function () {
    // #replace needs built-in support for named groups.
    // #match works fine because it just return the exec results, even if it has
    // a "grops" property.
    var re = /./;
    re.exec = function () {
      var result = [];
      result.groups = { a: '7' };
      return result;
    };
    return ''.replace(re, '$<a>') !== '7';
  });

  var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {
    // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
    var re = /(?:)/;
    var originalExec = re.exec;
    re.exec = function () { return originalExec.apply(this, arguments); };
    var result = 'ab'.split(re);
    return result.length === 2 && result[0] === 'a' && result[1] === 'b';
  })();

  var _fixReWks = function (KEY, length, exec) {
    var SYMBOL = _wks$1(KEY);

    var DELEGATES_TO_SYMBOL = !_fails$1(function () {
      // String methods call symbol-named RegEp methods
      var O = {};
      O[SYMBOL] = function () { return 7; };
      return ''[KEY](O) != 7;
    });

    var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !_fails$1(function () {
      // Symbol-named RegExp methods call .exec
      var execCalled = false;
      var re = /a/;
      re.exec = function () { execCalled = true; return null; };
      if (KEY === 'split') {
        // RegExp[@@split] doesn't call the regex's exec method, but first creates
        // a new one. We need to return the patched regex when creating the new one.
        re.constructor = {};
        re.constructor[SPECIES$2] = function () { return re; };
      }
      re[SYMBOL]('');
      return !execCalled;
    }) : undefined;

    if (
      !DELEGATES_TO_SYMBOL ||
      !DELEGATES_TO_EXEC ||
      (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
      (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
    ) {
      var nativeRegExpMethod = /./[SYMBOL];
      var fns = exec(
        _defined$1,
        SYMBOL,
        ''[KEY],
        function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
          if (regexp.exec === _regexpExec) {
            if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
              // The native String method already delegates to @@method (this
              // polyfilled function), leasing to infinite recursion.
              // We avoid it by directly calling the native @@method method.
              return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
            }
            return { done: true, value: nativeMethod.call(str, regexp, arg2) };
          }
          return { done: false };
        }
      );
      var strfn = fns[0];
      var rxfn = fns[1];

      _redefine$1(String.prototype, KEY, strfn);
      _hide$1(RegExp.prototype, SYMBOL, length == 2
        // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
        // 21.2.5.11 RegExp.prototype[@@split](string, limit)
        ? function (string, arg) { return rxfn.call(string, this, arg); }
        // 21.2.5.6 RegExp.prototype[@@match](string)
        // 21.2.5.9 RegExp.prototype[@@search](string)
        : function (string) { return rxfn.call(string, this); }
      );
    }
  };

  var max$1 = Math.max;
  var min$3 = Math.min;
  var floor$2 = Math.floor;
  var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
  var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;

  var maybeToString = function (it) {
    return it === undefined ? it : String(it);
  };

  // @@replace logic
  _fixReWks('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {
    return [
      // `String.prototype.replace` method
      // https://tc39.github.io/ecma262/#sec-string.prototype.replace
      function replace(searchValue, replaceValue) {
        var O = defined(this);
        var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
        return fn !== undefined
          ? fn.call(searchValue, O, replaceValue)
          : $replace.call(String(O), searchValue, replaceValue);
      },
      // `RegExp.prototype[@@replace]` method
      // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
      function (regexp, replaceValue) {
        var res = maybeCallNative($replace, regexp, this, replaceValue);
        if (res.done) return res.value;

        var rx = _anObject$1(regexp);
        var S = String(this);
        var functionalReplace = typeof replaceValue === 'function';
        if (!functionalReplace) replaceValue = String(replaceValue);
        var global = rx.global;
        if (global) {
          var fullUnicode = rx.unicode;
          rx.lastIndex = 0;
        }
        var results = [];
        while (true) {
          var result = _regexpExecAbstract(rx, S);
          if (result === null) break;
          results.push(result);
          if (!global) break;
          var matchStr = String(result[0]);
          if (matchStr === '') rx.lastIndex = _advanceStringIndex(S, _toLength$1(rx.lastIndex), fullUnicode);
        }
        var accumulatedResult = '';
        var nextSourcePosition = 0;
        for (var i = 0; i < results.length; i++) {
          result = results[i];
          var matched = String(result[0]);
          var position = max$1(min$3(_toInteger$1(result.index), S.length), 0);
          var captures = [];
          // NOTE: This is equivalent to
          //   captures = result.slice(1).map(maybeToString)
          // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
          // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
          // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
          for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
          var namedCaptures = result.groups;
          if (functionalReplace) {
            var replacerArgs = [matched].concat(captures, position, S);
            if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
            var replacement = String(replaceValue.apply(undefined, replacerArgs));
          } else {
            replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
          }
          if (position >= nextSourcePosition) {
            accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
            nextSourcePosition = position + matched.length;
          }
        }
        return accumulatedResult + S.slice(nextSourcePosition);
      }
    ];

      // https://tc39.github.io/ecma262/#sec-getsubstitution
    function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
      var tailPos = position + matched.length;
      var m = captures.length;
      var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
      if (namedCaptures !== undefined) {
        namedCaptures = _toObject$1(namedCaptures);
        symbols = SUBSTITUTION_SYMBOLS;
      }
      return $replace.call(replacement, symbols, function (match, ch) {
        var capture;
        switch (ch.charAt(0)) {
          case '$': return '$';
          case '&': return matched;
          case '`': return str.slice(0, position);
          case "'": return str.slice(tailPos);
          case '<':
            capture = namedCaptures[ch.slice(1, -1)];
            break;
          default: // \d\d?
            var n = +ch;
            if (n === 0) return match;
            if (n > m) {
              var f = floor$2(n / 10);
              if (f === 0) return match;
              if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
              return match;
            }
            capture = captures[n - 1];
        }
        return capture === undefined ? '' : capture;
      });
    }
  });

  // 19.1.3.6 Object.prototype.toString()

  var test = {};
  test[_wks$1('toStringTag')] = 'z';
  if (test + '' != '[object z]') {
    _redefine$1(Object.prototype, 'toString', function toString() {
      return '[object ' + _classof$1(this) + ']';
    }, true);
  }

  var _anInstance$1 = function (it, Constructor, name, forbiddenField) {
    if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
      throw TypeError(name + ': incorrect invocation!');
    } return it;
  };

  // call something on iterator step with safe closing on error

  var _iterCall$1 = function (iterator, fn, value, entries) {
    try {
      return entries ? fn(_anObject$1(value)[0], value[1]) : fn(value);
    // 7.4.6 IteratorClose(iterator, completion)
    } catch (e) {
      var ret = iterator['return'];
      if (ret !== undefined) _anObject$1(ret.call(iterator));
      throw e;
    }
  };

  var _iterators$1 = {};

  // check on default Array iterator

  var ITERATOR$4 = _wks$1('iterator');
  var ArrayProto$1 = Array.prototype;

  var _isArrayIter$1 = function (it) {
    return it !== undefined && (_iterators$1.Array === it || ArrayProto$1[ITERATOR$4] === it);
  };

  var ITERATOR$5 = _wks$1('iterator');

  var core_getIteratorMethod$1 = _core$1.getIteratorMethod = function (it) {
    if (it != undefined) return it[ITERATOR$5]
      || it['@@iterator']
      || _iterators$1[_classof$1(it)];
  };

  var _forOf$1 = createCommonjsModule(function (module) {
  var BREAK = {};
  var RETURN = {};
  var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
    var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod$1(iterable);
    var f = _ctx$1(fn, that, entries ? 2 : 1);
    var index = 0;
    var length, step, iterator, result;
    if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
    // fast case for arrays with default iterator
    if (_isArrayIter$1(iterFn)) for (length = _toLength$1(iterable.length); length > index; index++) {
      result = entries ? f(_anObject$1(step = iterable[index])[0], step[1]) : f(iterable[index]);
      if (result === BREAK || result === RETURN) return result;
    } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
      result = _iterCall$1(iterator, f, step.value, entries);
      if (result === BREAK || result === RETURN) return result;
    }
  };
  exports.BREAK = BREAK;
  exports.RETURN = RETURN;
  });

  // 7.3.20 SpeciesConstructor(O, defaultConstructor)


  var SPECIES$3 = _wks$1('species');
  var _speciesConstructor$1 = function (O, D) {
    var C = _anObject$1(O).constructor;
    var S;
    return C === undefined || (S = _anObject$1(C)[SPECIES$3]) == undefined ? D : _aFunction$1(S);
  };

  // fast apply, http://jsperf.lnkit.com/fast-apply/5
  var _invoke$1 = function (fn, args, that) {
    var un = that === undefined;
    switch (args.length) {
      case 0: return un ? fn()
                        : fn.call(that);
      case 1: return un ? fn(args[0])
                        : fn.call(that, args[0]);
      case 2: return un ? fn(args[0], args[1])
                        : fn.call(that, args[0], args[1]);
      case 3: return un ? fn(args[0], args[1], args[2])
                        : fn.call(that, args[0], args[1], args[2]);
      case 4: return un ? fn(args[0], args[1], args[2], args[3])
                        : fn.call(that, args[0], args[1], args[2], args[3]);
    } return fn.apply(that, args);
  };

  var document$4 = _global$1.document;
  var _html$1 = document$4 && document$4.documentElement;

  var process$3 = _global$1.process;
  var setTask$1 = _global$1.setImmediate;
  var clearTask$1 = _global$1.clearImmediate;
  var MessageChannel$1 = _global$1.MessageChannel;
  var Dispatch$1 = _global$1.Dispatch;
  var counter$1 = 0;
  var queue$1 = {};
  var ONREADYSTATECHANGE$1 = 'onreadystatechange';
  var defer$1, channel$1, port$1;
  var run$1 = function () {
    var id = +this;
    // eslint-disable-next-line no-prototype-builtins
    if (queue$1.hasOwnProperty(id)) {
      var fn = queue$1[id];
      delete queue$1[id];
      fn();
    }
  };
  var listener$1 = function (event) {
    run$1.call(event.data);
  };
  // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
  if (!setTask$1 || !clearTask$1) {
    setTask$1 = function setImmediate(fn) {
      var args = [];
      var i = 1;
      while (arguments.length > i) args.push(arguments[i++]);
      queue$1[++counter$1] = function () {
        // eslint-disable-next-line no-new-func
        _invoke$1(typeof fn == 'function' ? fn : Function(fn), args);
      };
      defer$1(counter$1);
      return counter$1;
    };
    clearTask$1 = function clearImmediate(id) {
      delete queue$1[id];
    };
    // Node.js 0.8-
    if (_cof$1(process$3) == 'process') {
      defer$1 = function (id) {
        process$3.nextTick(_ctx$1(run$1, id, 1));
      };
    // Sphere (JS game engine) Dispatch API
    } else if (Dispatch$1 && Dispatch$1.now) {
      defer$1 = function (id) {
        Dispatch$1.now(_ctx$1(run$1, id, 1));
      };
    // Browsers with MessageChannel, includes WebWorkers
    } else if (MessageChannel$1) {
      channel$1 = new MessageChannel$1();
      port$1 = channel$1.port2;
      channel$1.port1.onmessage = listener$1;
      defer$1 = _ctx$1(port$1.postMessage, port$1, 1);
    // Browsers with postMessage, skip WebWorkers
    // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
    } else if (_global$1.addEventListener && typeof postMessage == 'function' && !_global$1.importScripts) {
      defer$1 = function (id) {
        _global$1.postMessage(id + '', '*');
      };
      _global$1.addEventListener('message', listener$1, false);
    // IE8-
    } else if (ONREADYSTATECHANGE$1 in _domCreate$1('script')) {
      defer$1 = function (id) {
        _html$1.appendChild(_domCreate$1('script'))[ONREADYSTATECHANGE$1] = function () {
          _html$1.removeChild(this);
          run$1.call(id);
        };
      };
    // Rest old browsers
    } else {
      defer$1 = function (id) {
        setTimeout(_ctx$1(run$1, id, 1), 0);
      };
    }
  }
  var _task$1 = {
    set: setTask$1,
    clear: clearTask$1
  };

  var macrotask$1 = _task$1.set;
  var Observer$1 = _global$1.MutationObserver || _global$1.WebKitMutationObserver;
  var process$4 = _global$1.process;
  var Promise$1 = _global$1.Promise;
  var isNode$2 = _cof$1(process$4) == 'process';

  var _microtask$1 = function () {
    var head, last, notify;

    var flush = function () {
      var parent, fn;
      if (isNode$2 && (parent = process$4.domain)) parent.exit();
      while (head) {
        fn = head.fn;
        head = head.next;
        try {
          fn();
        } catch (e) {
          if (head) notify();
          else last = undefined;
          throw e;
        }
      } last = undefined;
      if (parent) parent.enter();
    };

    // Node.js
    if (isNode$2) {
      notify = function () {
        process$4.nextTick(flush);
      };
    // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
    } else if (Observer$1 && !(_global$1.navigator && _global$1.navigator.standalone)) {
      var toggle = true;
      var node = document.createTextNode('');
      new Observer$1(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
      notify = function () {
        node.data = toggle = !toggle;
      };
    // environments with maybe non-completely correct, but existent Promise
    } else if (Promise$1 && Promise$1.resolve) {
      // Promise.resolve without an argument throws an error in LG WebOS 2
      var promise = Promise$1.resolve(undefined);
      notify = function () {
        promise.then(flush);
      };
    // for other environments - macrotask based on:
    // - setImmediate
    // - MessageChannel
    // - window.postMessag
    // - onreadystatechange
    // - setTimeout
    } else {
      notify = function () {
        // strange IE + webpack dev server bug - use .call(global)
        macrotask$1.call(_global$1, flush);
      };
    }

    return function (fn) {
      var task = { fn: fn, next: undefined };
      if (last) last.next = task;
      if (!head) {
        head = task;
        notify();
      } last = task;
    };
  };

  // 25.4.1.5 NewPromiseCapability(C)


  function PromiseCapability$1(C) {
    var resolve, reject;
    this.promise = new C(function ($$resolve, $$reject) {
      if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
      resolve = $$resolve;
      reject = $$reject;
    });
    this.resolve = _aFunction$1(resolve);
    this.reject = _aFunction$1(reject);
  }

  var f$3 = function (C) {
    return new PromiseCapability$1(C);
  };

  var _newPromiseCapability$1 = {
  	f: f$3
  };

  var _perform$1 = function (exec) {
    try {
      return { e: false, v: exec() };
    } catch (e) {
      return { e: true, v: e };
    }
  };

  var navigator$2 = _global$1.navigator;

  var _userAgent$1 = navigator$2 && navigator$2.userAgent || '';

  var _promiseResolve$1 = function (C, x) {
    _anObject$1(C);
    if (_isObject$1(x) && x.constructor === C) return x;
    var promiseCapability = _newPromiseCapability$1.f(C);
    var resolve = promiseCapability.resolve;
    resolve(x);
    return promiseCapability.promise;
  };

  var _redefineAll$1 = function (target, src, safe) {
    for (var key in src) _redefine$1(target, key, src[key], safe);
    return target;
  };

  var def$1 = _objectDp$1.f;

  var TAG$3 = _wks$1('toStringTag');

  var _setToStringTag$1 = function (it, tag, stat) {
    if (it && !_has$1(it = stat ? it : it.prototype, TAG$3)) def$1(it, TAG$3, { configurable: true, value: tag });
  };

  var SPECIES$4 = _wks$1('species');

  var _setSpecies$1 = function (KEY) {
    var C = _global$1[KEY];
    if (_descriptors$1 && C && !C[SPECIES$4]) _objectDp$1.f(C, SPECIES$4, {
      configurable: true,
      get: function () { return this; }
    });
  };

  var ITERATOR$6 = _wks$1('iterator');
  var SAFE_CLOSING$1 = false;

  try {
    var riter$1 = [7][ITERATOR$6]();
    riter$1['return'] = function () { SAFE_CLOSING$1 = true; };
    // eslint-disable-next-line no-throw-literal
    Array.from(riter$1, function () { throw 2; });
  } catch (e) { /* empty */ }

  var _iterDetect$1 = function (exec, skipClosing) {
    if (!skipClosing && !SAFE_CLOSING$1) return false;
    var safe = false;
    try {
      var arr = [7];
      var iter = arr[ITERATOR$6]();
      iter.next = function () { return { done: safe = true }; };
      arr[ITERATOR$6] = function () { return iter; };
      exec(arr);
    } catch (e) { /* empty */ }
    return safe;
  };

  var task$1 = _task$1.set;
  var microtask$1 = _microtask$1();




  var PROMISE$1 = 'Promise';
  var TypeError$2 = _global$1.TypeError;
  var process$5 = _global$1.process;
  var versions$1 = process$5 && process$5.versions;
  var v8$1 = versions$1 && versions$1.v8 || '';
  var $Promise$1 = _global$1[PROMISE$1];
  var isNode$3 = _classof$1(process$5) == 'process';
  var empty$1 = function () { /* empty */ };
  var Internal$1, newGenericPromiseCapability$1, OwnPromiseCapability$1, Wrapper$1;
  var newPromiseCapability$1 = newGenericPromiseCapability$1 = _newPromiseCapability$1.f;

  var USE_NATIVE$1 = !!function () {
    try {
      // correct subclassing with @@species support
      var promise = $Promise$1.resolve(1);
      var FakePromise = (promise.constructor = {})[_wks$1('species')] = function (exec) {
        exec(empty$1, empty$1);
      };
      // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
      return (isNode$3 || typeof PromiseRejectionEvent == 'function')
        && promise.then(empty$1) instanceof FakePromise
        // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
        // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
        // we can't detect it synchronously, so just check versions
        && v8$1.indexOf('6.6') !== 0
        && _userAgent$1.indexOf('Chrome/66') === -1;
    } catch (e) { /* empty */ }
  }();

  // helpers
  var isThenable$1 = function (it) {
    var then;
    return _isObject$1(it) && typeof (then = it.then) == 'function' ? then : false;
  };
  var notify$1 = function (promise, isReject) {
    if (promise._n) return;
    promise._n = true;
    var chain = promise._c;
    microtask$1(function () {
      var value = promise._v;
      var ok = promise._s == 1;
      var i = 0;
      var run = function (reaction) {
        var handler = ok ? reaction.ok : reaction.fail;
        var resolve = reaction.resolve;
        var reject = reaction.reject;
        var domain = reaction.domain;
        var result, then, exited;
        try {
          if (handler) {
            if (!ok) {
              if (promise._h == 2) onHandleUnhandled$1(promise);
              promise._h = 1;
            }
            if (handler === true) result = value;
            else {
              if (domain) domain.enter();
              result = handler(value); // may throw
              if (domain) {
                domain.exit();
                exited = true;
              }
            }
            if (result === reaction.promise) {
              reject(TypeError$2('Promise-chain cycle'));
            } else if (then = isThenable$1(result)) {
              then.call(result, resolve, reject);
            } else resolve(result);
          } else reject(value);
        } catch (e) {
          if (domain && !exited) domain.exit();
          reject(e);
        }
      };
      while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
      promise._c = [];
      promise._n = false;
      if (isReject && !promise._h) onUnhandled$1(promise);
    });
  };
  var onUnhandled$1 = function (promise) {
    task$1.call(_global$1, function () {
      var value = promise._v;
      var unhandled = isUnhandled$1(promise);
      var result, handler, console;
      if (unhandled) {
        result = _perform$1(function () {
          if (isNode$3) {
            process$5.emit('unhandledRejection', value, promise);
          } else if (handler = _global$1.onunhandledrejection) {
            handler({ promise: promise, reason: value });
          } else if ((console = _global$1.console) && console.error) {
            console.error('Unhandled promise rejection', value);
          }
        });
        // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
        promise._h = isNode$3 || isUnhandled$1(promise) ? 2 : 1;
      } promise._a = undefined;
      if (unhandled && result.e) throw result.v;
    });
  };
  var isUnhandled$1 = function (promise) {
    return promise._h !== 1 && (promise._a || promise._c).length === 0;
  };
  var onHandleUnhandled$1 = function (promise) {
    task$1.call(_global$1, function () {
      var handler;
      if (isNode$3) {
        process$5.emit('rejectionHandled', promise);
      } else if (handler = _global$1.onrejectionhandled) {
        handler({ promise: promise, reason: promise._v });
      }
    });
  };
  var $reject$1 = function (value) {
    var promise = this;
    if (promise._d) return;
    promise._d = true;
    promise = promise._w || promise; // unwrap
    promise._v = value;
    promise._s = 2;
    if (!promise._a) promise._a = promise._c.slice();
    notify$1(promise, true);
  };
  var $resolve$1 = function (value) {
    var promise = this;
    var then;
    if (promise._d) return;
    promise._d = true;
    promise = promise._w || promise; // unwrap
    try {
      if (promise === value) throw TypeError$2("Promise can't be resolved itself");
      if (then = isThenable$1(value)) {
        microtask$1(function () {
          var wrapper = { _w: promise, _d: false }; // wrap
          try {
            then.call(value, _ctx$1($resolve$1, wrapper, 1), _ctx$1($reject$1, wrapper, 1));
          } catch (e) {
            $reject$1.call(wrapper, e);
          }
        });
      } else {
        promise._v = value;
        promise._s = 1;
        notify$1(promise, false);
      }
    } catch (e) {
      $reject$1.call({ _w: promise, _d: false }, e); // wrap
    }
  };

  // constructor polyfill
  if (!USE_NATIVE$1) {
    // 25.4.3.1 Promise(executor)
    $Promise$1 = function Promise(executor) {
      _anInstance$1(this, $Promise$1, PROMISE$1, '_h');
      _aFunction$1(executor);
      Internal$1.call(this);
      try {
        executor(_ctx$1($resolve$1, this, 1), _ctx$1($reject$1, this, 1));
      } catch (err) {
        $reject$1.call(this, err);
      }
    };
    // eslint-disable-next-line no-unused-vars
    Internal$1 = function Promise(executor) {
      this._c = [];             // <- awaiting reactions
      this._a = undefined;      // <- checked in isUnhandled reactions
      this._s = 0;              // <- state
      this._d = false;          // <- done
      this._v = undefined;      // <- value
      this._h = 0;              // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
      this._n = false;          // <- notify
    };
    Internal$1.prototype = _redefineAll$1($Promise$1.prototype, {
      // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
      then: function then(onFulfilled, onRejected) {
        var reaction = newPromiseCapability$1(_speciesConstructor$1(this, $Promise$1));
        reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
        reaction.fail = typeof onRejected == 'function' && onRejected;
        reaction.domain = isNode$3 ? process$5.domain : undefined;
        this._c.push(reaction);
        if (this._a) this._a.push(reaction);
        if (this._s) notify$1(this, false);
        return reaction.promise;
      },
      // 25.4.5.1 Promise.prototype.catch(onRejected)
      'catch': function (onRejected) {
        return this.then(undefined, onRejected);
      }
    });
    OwnPromiseCapability$1 = function () {
      var promise = new Internal$1();
      this.promise = promise;
      this.resolve = _ctx$1($resolve$1, promise, 1);
      this.reject = _ctx$1($reject$1, promise, 1);
    };
    _newPromiseCapability$1.f = newPromiseCapability$1 = function (C) {
      return C === $Promise$1 || C === Wrapper$1
        ? new OwnPromiseCapability$1(C)
        : newGenericPromiseCapability$1(C);
    };
  }

  _export$1(_export$1.G + _export$1.W + _export$1.F * !USE_NATIVE$1, { Promise: $Promise$1 });
  _setToStringTag$1($Promise$1, PROMISE$1);
  _setSpecies$1(PROMISE$1);
  Wrapper$1 = _core$1[PROMISE$1];

  // statics
  _export$1(_export$1.S + _export$1.F * !USE_NATIVE$1, PROMISE$1, {
    // 25.4.4.5 Promise.reject(r)
    reject: function reject(r) {
      var capability = newPromiseCapability$1(this);
      var $$reject = capability.reject;
      $$reject(r);
      return capability.promise;
    }
  });
  _export$1(_export$1.S + _export$1.F * ( !USE_NATIVE$1), PROMISE$1, {
    // 25.4.4.6 Promise.resolve(x)
    resolve: function resolve(x) {
      return _promiseResolve$1( this, x);
    }
  });
  _export$1(_export$1.S + _export$1.F * !(USE_NATIVE$1 && _iterDetect$1(function (iter) {
    $Promise$1.all(iter)['catch'](empty$1);
  })), PROMISE$1, {
    // 25.4.4.1 Promise.all(iterable)
    all: function all(iterable) {
      var C = this;
      var capability = newPromiseCapability$1(C);
      var resolve = capability.resolve;
      var reject = capability.reject;
      var result = _perform$1(function () {
        var values = [];
        var index = 0;
        var remaining = 1;
        _forOf$1(iterable, false, function (promise) {
          var $index = index++;
          var alreadyCalled = false;
          values.push(undefined);
          remaining++;
          C.resolve(promise).then(function (value) {
            if (alreadyCalled) return;
            alreadyCalled = true;
            values[$index] = value;
            --remaining || resolve(values);
          }, reject);
        });
        --remaining || resolve(values);
      });
      if (result.e) reject(result.v);
      return capability.promise;
    },
    // 25.4.4.4 Promise.race(iterable)
    race: function race(iterable) {
      var C = this;
      var capability = newPromiseCapability$1(C);
      var reject = capability.reject;
      var result = _perform$1(function () {
        _forOf$1(iterable, false, function (promise) {
          C.resolve(promise).then(capability.resolve, reject);
        });
      });
      if (result.e) reject(result.v);
      return capability.promise;
    }
  });

  var dP$2 = _objectDp$1.f;
  var FProto = Function.prototype;
  var nameRE = /^\s*function ([^ (]*)/;
  var NAME$1 = 'name';

  // 19.2.4.2 name
  NAME$1 in FProto || _descriptors$1 && dP$2(FProto, NAME$1, {
    configurable: true,
    get: function () {
      try {
        return ('' + this).match(nameRE)[1];
      } catch (e) {
        return '';
      }
    }
  });

  // 7.2.8 IsRegExp(argument)


  var MATCH = _wks$1('match');
  var _isRegexp = function (it) {
    var isRegExp;
    return _isObject$1(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : _cof$1(it) == 'RegExp');
  };

  // helper for String#{startsWith, endsWith, includes}



  var _stringContext = function (that, searchString, NAME) {
    if (_isRegexp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
    return String(_defined$1(that));
  };

  var MATCH$1 = _wks$1('match');
  var _failsIsRegexp = function (KEY) {
    var re = /./;
    try {
      '/./'[KEY](re);
    } catch (e) {
      try {
        re[MATCH$1] = false;
        return !'/./'[KEY](re);
      } catch (f) { /* empty */ }
    } return true;
  };

  var INCLUDES = 'includes';

  _export$1(_export$1.P + _export$1.F * _failsIsRegexp(INCLUDES), 'String', {
    includes: function includes(searchString /* , position = 0 */) {
      return !!~_stringContext(this, searchString, INCLUDES)
        .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
    }
  });

  // fallback for non-array-like ES3 and non-enumerable old V8 strings

  // eslint-disable-next-line no-prototype-builtins
  var _iobject$1 = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
    return _cof$1(it) == 'String' ? it.split('') : Object(it);
  };

  // to indexed object, toObject with fallback for non-array-like ES3 strings


  var _toIobject$1 = function (it) {
    return _iobject$1(_defined$1(it));
  };

  var max$2 = Math.max;
  var min$4 = Math.min;
  var _toAbsoluteIndex$1 = function (index, length) {
    index = _toInteger$1(index);
    return index < 0 ? max$2(index + length, 0) : min$4(index, length);
  };

  // false -> Array#indexOf
  // true  -> Array#includes



  var _arrayIncludes$1 = function (IS_INCLUDES) {
    return function ($this, el, fromIndex) {
      var O = _toIobject$1($this);
      var length = _toLength$1(O.length);
      var index = _toAbsoluteIndex$1(fromIndex, length);
      var value;
      // Array#includes uses SameValueZero equality algorithm
      // eslint-disable-next-line no-self-compare
      if (IS_INCLUDES && el != el) while (length > index) {
        value = O[index++];
        // eslint-disable-next-line no-self-compare
        if (value != value) return true;
      // Array#indexOf ignores holes, Array#includes - not
      } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
        if (O[index] === el) return IS_INCLUDES || index || 0;
      } return !IS_INCLUDES && -1;
    };
  };

  // 22.1.3.31 Array.prototype[@@unscopables]
  var UNSCOPABLES = _wks$1('unscopables');
  var ArrayProto$2 = Array.prototype;
  if (ArrayProto$2[UNSCOPABLES] == undefined) _hide$1(ArrayProto$2, UNSCOPABLES, {});
  var _addToUnscopables = function (key) {
    ArrayProto$2[UNSCOPABLES][key] = true;
  };

  // https://github.com/tc39/Array.prototype.includes

  var $includes = _arrayIncludes$1(true);

  _export$1(_export$1.P, 'Array', {
    includes: function includes(el /* , fromIndex = 0 */) {
      return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
    }
  });

  _addToUnscopables('includes');

  // 7.2.2 IsArray(argument)

  var _isArray = Array.isArray || function isArray(arg) {
    return _cof$1(arg) == 'Array';
  };

  var SPECIES$5 = _wks$1('species');

  var _arraySpeciesConstructor = function (original) {
    var C;
    if (_isArray(original)) {
      C = original.constructor;
      // cross-realm fallback
      if (typeof C == 'function' && (C === Array || _isArray(C.prototype))) C = undefined;
      if (_isObject$1(C)) {
        C = C[SPECIES$5];
        if (C === null) C = undefined;
      }
    } return C === undefined ? Array : C;
  };

  // 9.4.2.3 ArraySpeciesCreate(originalArray, length)


  var _arraySpeciesCreate = function (original, length) {
    return new (_arraySpeciesConstructor(original))(length);
  };

  // 0 -> Array#forEach
  // 1 -> Array#map
  // 2 -> Array#filter
  // 3 -> Array#some
  // 4 -> Array#every
  // 5 -> Array#find
  // 6 -> Array#findIndex





  var _arrayMethods = function (TYPE, $create) {
    var IS_MAP = TYPE == 1;
    var IS_FILTER = TYPE == 2;
    var IS_SOME = TYPE == 3;
    var IS_EVERY = TYPE == 4;
    var IS_FIND_INDEX = TYPE == 6;
    var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
    var create = $create || _arraySpeciesCreate;
    return function ($this, callbackfn, that) {
      var O = _toObject$1($this);
      var self = _iobject$1(O);
      var f = _ctx$1(callbackfn, that, 3);
      var length = _toLength$1(self.length);
      var index = 0;
      var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
      var val, res;
      for (;length > index; index++) if (NO_HOLES || index in self) {
        val = self[index];
        res = f(val, index, O);
        if (TYPE) {
          if (IS_MAP) result[index] = res;   // map
          else if (res) switch (TYPE) {
            case 3: return true;             // some
            case 5: return val;              // find
            case 6: return index;            // findIndex
            case 2: result.push(val);        // filter
          } else if (IS_EVERY) return false; // every
        }
      }
      return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
    };
  };

  var _strictMethod = function (method, arg) {
    return !!method && _fails$1(function () {
      // eslint-disable-next-line no-useless-call
      arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
    });
  };

  var $map = _arrayMethods(1);

  _export$1(_export$1.P + _export$1.F * !_strictMethod([].map, true), 'Array', {
    // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
    map: function map(callbackfn /* , thisArg */) {
      return $map(this, callbackfn, arguments[1]);
    }
  });

  var arraySlice = [].slice;

  // fallback for not array-like ES3 strings and DOM objects
  _export$1(_export$1.P + _export$1.F * _fails$1(function () {
    if (_html$1) arraySlice.call(_html$1);
  }), 'Array', {
    slice: function slice(begin, end) {
      var len = _toLength$1(this.length);
      var klass = _cof$1(this);
      end = end === undefined ? len : end;
      if (klass == 'Array') return arraySlice.call(this, begin, end);
      var start = _toAbsoluteIndex$1(begin, len);
      var upTo = _toAbsoluteIndex$1(end, len);
      var size = _toLength$1(upTo - start);
      var cloned = new Array(size);
      var i = 0;
      for (; i < size; i++) cloned[i] = klass == 'String'
        ? this.charAt(start + i)
        : this[start + i];
      return cloned;
    }
  });

  var EventEmitter = function () {
    function EventEmitter() {
      _classCallCheck(this, EventEmitter);

      this.events = {};
      this.token = '';
    }

    _createClass(EventEmitter, [{
      key: "on",
      value: function on(eventName, callback) {
        this.events[eventName] = this.events[eventName] || [];
        this.events[eventName].push(callback);
      }
    }, {
      key: "emit",
      value: function emit(eventName) {
        var events = this.events[eventName],
            args = Array.prototype.slice.call(arguments, 1),
            i,
            m;

        if (!events) {
          return;
        }

        for (i = 0, m = events.length; i < m; i++) {
          events[i].apply(null, args);
        }
      }
    }, {
      key: "clear",
      value: function clear() {
        this.events = {};
      }
    }]);

    return EventEmitter;
  }();

  // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
  _export(_export.S + _export.F * !_descriptors, 'Object', { defineProperty: _objectDp.f });

  var $Object = _core.Object;
  var defineProperty = function defineProperty(it, key, desc) {
    return $Object.defineProperty(it, key, desc);
  };

  var defineProperty$1 = defineProperty;

  var valieRegExp = /^\s*(null|undefined)?\s*$/i;
  function isValidURLData(value) {
    return isNumber(value) || isBoolean(value) || isArray(value) || !!value && isString(value) && !valieRegExp.test(value) || isPureObject(value);
  }
  function isObject(value) {
    return _typeof(value) === "object";
  }
  function isPureObject(value) {
    return Object.prototype.toString.call(value) === "[object Object]";
  }
  function isArray(value) {
    return Object.prototype.toString.call(value) === "[object Array]";
  }
  function isFunction(value) {
    return typeof value === "function";
  }
  function isString(value) {
    return typeof value === "string";
  }
  function isNumber(value) {
    return typeof value === "number";
  }
  function isBoolean(value) {
    return typeof value === "boolean";
  }

  var $min = Math.min;
  var $push = [].push;
  var $SPLIT = 'split';
  var LENGTH = 'length';
  var LAST_INDEX$1 = 'lastIndex';
  var MAX_UINT32 = 0xffffffff;

  // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
  var SUPPORTS_Y = !_fails$1(function () { RegExp(MAX_UINT32, 'y'); });

  // @@split logic
  _fixReWks('split', 2, function (defined, SPLIT, $split, maybeCallNative) {
    var internalSplit;
    if (
      'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
      'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
      'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
      '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
      '.'[$SPLIT](/()()/)[LENGTH] > 1 ||
      ''[$SPLIT](/.?/)[LENGTH]
    ) {
      // based on es5-shim implementation, need to rework it
      internalSplit = function (separator, limit) {
        var string = String(this);
        if (separator === undefined && limit === 0) return [];
        // If `separator` is not a regex, use native split
        if (!_isRegexp(separator)) return $split.call(string, separator, limit);
        var output = [];
        var flags = (separator.ignoreCase ? 'i' : '') +
                    (separator.multiline ? 'm' : '') +
                    (separator.unicode ? 'u' : '') +
                    (separator.sticky ? 'y' : '');
        var lastLastIndex = 0;
        var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0;
        // Make `global` and avoid `lastIndex` issues by working with a copy
        var separatorCopy = new RegExp(separator.source, flags + 'g');
        var match, lastIndex, lastLength;
        while (match = _regexpExec.call(separatorCopy, string)) {
          lastIndex = separatorCopy[LAST_INDEX$1];
          if (lastIndex > lastLastIndex) {
            output.push(string.slice(lastLastIndex, match.index));
            if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));
            lastLength = match[0][LENGTH];
            lastLastIndex = lastIndex;
            if (output[LENGTH] >= splitLimit) break;
          }
          if (separatorCopy[LAST_INDEX$1] === match.index) separatorCopy[LAST_INDEX$1]++; // Avoid an infinite loop
        }
        if (lastLastIndex === string[LENGTH]) {
          if (lastLength || !separatorCopy.test('')) output.push('');
        } else output.push(string.slice(lastLastIndex));
        return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
      };
    // Chakra, V8
    } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {
      internalSplit = function (separator, limit) {
        return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit);
      };
    } else {
      internalSplit = $split;
    }

    return [
      // `String.prototype.split` method
      // https://tc39.github.io/ecma262/#sec-string.prototype.split
      function split(separator, limit) {
        var O = defined(this);
        var splitter = separator == undefined ? undefined : separator[SPLIT];
        return splitter !== undefined
          ? splitter.call(separator, O, limit)
          : internalSplit.call(String(O), separator, limit);
      },
      // `RegExp.prototype[@@split]` method
      // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
      //
      // NOTE: This cannot be properly polyfilled in engines that don't support
      // the 'y' flag.
      function (regexp, limit) {
        var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split);
        if (res.done) return res.value;

        var rx = _anObject$1(regexp);
        var S = String(this);
        var C = _speciesConstructor$1(rx, RegExp);

        var unicodeMatching = rx.unicode;
        var flags = (rx.ignoreCase ? 'i' : '') +
                    (rx.multiline ? 'm' : '') +
                    (rx.unicode ? 'u' : '') +
                    (SUPPORTS_Y ? 'y' : 'g');

        // ^(? + rx + ) is needed, in combination with some S slicing, to
        // simulate the 'y' flag.
        var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
        var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
        if (lim === 0) return [];
        if (S.length === 0) return _regexpExecAbstract(splitter, S) === null ? [S] : [];
        var p = 0;
        var q = 0;
        var A = [];
        while (q < S.length) {
          splitter.lastIndex = SUPPORTS_Y ? q : 0;
          var z = _regexpExecAbstract(splitter, SUPPORTS_Y ? S : S.slice(q));
          var e;
          if (
            z === null ||
            (e = $min(_toLength$1(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
          ) {
            q = _advanceStringIndex(S, q, unicodeMatching);
          } else {
            A.push(S.slice(p, q));
            if (A.length === lim) return A;
            for (var i = 1; i <= z.length - 1; i++) {
              A.push(z[i]);
              if (A.length === lim) return A;
            }
            q = p = e;
          }
        }
        A.push(S.slice(p));
        return A;
      }
    ];
  });

  // 21.2.5.3 get RegExp.prototype.flags()
  if (_descriptors$1 && /./g.flags != 'g') _objectDp$1.f(RegExp.prototype, 'flags', {
    configurable: true,
    get: _flags
  });

  var TO_STRING = 'toString';
  var $toString = /./[TO_STRING];

  var define = function (fn) {
    _redefine$1(RegExp.prototype, TO_STRING, fn, true);
  };

  // 21.2.5.14 RegExp.prototype.toString()
  if (_fails$1(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {
    define(function toString() {
      var R = _anObject$1(this);
      return '/'.concat(R.source, '/',
        'flags' in R ? R.flags : !_descriptors$1 && R instanceof RegExp ? _flags.call(R) : undefined);
    });
  // FF44- RegExp#toString has a wrong name
  } else if ($toString.name != TO_STRING) {
    define(function toString() {
      return $toString.call(this);
    });
  }

  // @@match logic
  _fixReWks('match', 1, function (defined, MATCH, $match, maybeCallNative) {
    return [
      // `String.prototype.match` method
      // https://tc39.github.io/ecma262/#sec-string.prototype.match
      function match(regexp) {
        var O = defined(this);
        var fn = regexp == undefined ? undefined : regexp[MATCH];
        return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
      },
      // `RegExp.prototype[@@match]` method
      // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
      function (regexp) {
        var res = maybeCallNative($match, regexp, this);
        if (res.done) return res.value;
        var rx = _anObject$1(regexp);
        var S = String(this);
        if (!rx.global) return _regexpExecAbstract(rx, S);
        var fullUnicode = rx.unicode;
        rx.lastIndex = 0;
        var A = [];
        var n = 0;
        var result;
        while ((result = _regexpExecAbstract(rx, S)) !== null) {
          var matchStr = String(result[0]);
          A[n] = matchStr;
          if (matchStr === '') rx.lastIndex = _advanceStringIndex(S, _toLength$1(rx.lastIndex), fullUnicode);
          n++;
        }
        return n === 0 ? null : A;
      }
    ];
  });

  // 7.2.9 SameValue(x, y)
  var _sameValue = Object.is || function is(x, y) {
    // eslint-disable-next-line no-self-compare
    return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
  };

  // @@search logic
  _fixReWks('search', 1, function (defined, SEARCH, $search, maybeCallNative) {
    return [
      // `String.prototype.search` method
      // https://tc39.github.io/ecma262/#sec-string.prototype.search
      function search(regexp) {
        var O = defined(this);
        var fn = regexp == undefined ? undefined : regexp[SEARCH];
        return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
      },
      // `RegExp.prototype[@@search]` method
      // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
      function (regexp) {
        var res = maybeCallNative($search, regexp, this);
        if (res.done) return res.value;
        var rx = _anObject$1(regexp);
        var S = String(this);
        var previousLastIndex = rx.lastIndex;
        if (!_sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
        var result = _regexpExecAbstract(rx, S);
        if (!_sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
        return result === null ? -1 : result.index;
      }
    ];
  });

  // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)

  var $find = _arrayMethods(5);
  var KEY = 'find';
  var forced = true;
  // Shouldn't skip holes
  if (KEY in []) Array(1)[KEY](function () { forced = false; });
  _export$1(_export$1.P + _export$1.F * forced, 'Array', {
    find: function find(callbackfn /* , that = undefined */) {
      return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
    }
  });
  _addToUnscopables(KEY);

  var warn = function warn() {};
  var log = function log() {};
  var error = function error(msg) {
    console.log("[cc error]: ".concat(msg));
  };

  {
    warn = function warn(msg) {
      if (_typeof(msg) === 'object') {
        msg = stringify$1(msg);
      }

      console.warn("[cc warning]: ".concat(msg));
    };

    log = function log(msg) {
      if (_typeof(msg) === 'object') {
        msg = stringify$1(msg);
      }

      console.log("[cc logs]: ".concat(msg));
    };

    error = function error(msg) {
      if (_typeof(msg) === 'object') {
        msg = stringify$1(msg);
      }

      console.error("[cc error]: ".concat(msg));
    };
  }

  var noop = function noop() {};
  var def$2 = function def(obj, key, value) {
    var enumerable = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
    var desc = {
      value: value,
      enumerable: !!enumerable,
      writable: true,
      configurable: true
    };

    defineProperty$1(obj, key, desc);
  };
  var objIsEmpty = function objIsEmpty(obj) {
    var objKeysArray = keys$1(obj);

    if (objKeysArray.length === 0) {
      return true;
    } else {
      return false;
    }
  };
  var parsePath = function parsePath(path) {
    if (!/^\w+$/.test(path)) {
      return void 0;
    }

    var segments = path.split('.');
    return function (obj) {
      for (var i = 0, l = segments.length; i < l; ++i) {
        if (!obj) return void 0;
        obj = obj[segments[i]];
      }

      return obj;
    };
  };
  var formatParams = function formatParams(data) {
    var arr = [];

    for (var name in data) {
      arr.push(encodeURIComponent(name) + '=' + encodeURIComponent(data[name]));
    }

    return arr.join('&');
  };
  var getUserAgent = function getUserAgent() {
    var sUserAgent = window.navigator.userAgent.toLowerCase();
    return sUserAgent;
  };
  var isMobile = function isMobile() {
    if (navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)) return true;else return false;
  };
  var isAndroid = function isAndroid() {
    var sUserAgent = getUserAgent();
    return sUserAgent.match(/android/i) != null;
  };

  var f$4 = {}.propertyIsEnumerable;

  var _objectPie = {
  	f: f$4
  };

  var gOPD = Object.getOwnPropertyDescriptor;

  var f$5 = _descriptors ? gOPD : function getOwnPropertyDescriptor(O, P) {
    O = _toIobject(O);
    P = _toPrimitive(P, true);
    if (_ie8DomDefine) try {
      return gOPD(O, P);
    } catch (e) { /* empty */ }
    if (_has(O, P)) return _propertyDesc(!_objectPie.f.call(O, P), O[P]);
  };

  var _objectGopd = {
  	f: f$5
  };

  // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)

  var $getOwnPropertyDescriptor = _objectGopd.f;

  _objectSap('getOwnPropertyDescriptor', function () {
    return function getOwnPropertyDescriptor(it, key) {
      return $getOwnPropertyDescriptor(_toIobject(it), key);
    };
  });

  var $Object$1 = _core.Object;
  var getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
    return $Object$1.getOwnPropertyDescriptor(it, key);
  };

  var getOwnPropertyDescriptor$1 = getOwnPropertyDescriptor;

  // 19.1.2.11 Object.isExtensible(O)


  _objectSap('isExtensible', function ($isExtensible) {
    return function isExtensible(it) {
      return _isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
    };
  });

  var isExtensible = _core.Object.isExtensible;

  var isExtensible$1 = isExtensible;

  var $filter = _arrayMethods(2);

  _export$1(_export$1.P + _export$1.F * !_strictMethod([].filter, true), 'Array', {
    // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
    filter: function filter(callbackfn /* , thisArg */) {
      return $filter(this, callbackfn, arguments[1]);
    }
  });

  var depAutoId = 0;
  var Dep = function () {
    function Dep() {
      _classCallCheck(this, Dep);

      this.id = ++depAutoId;
      this.watchers = new WatcherList();
    }

    _createClass(Dep, [{
      key: "addWatcher",
      value: function addWatcher() {
        var watcher = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;

        if (watcher && !this.watchers.has(watcher)) {
          this.watchers.add(watcher);
        }
      }
    }, {
      key: "removeWatcher",
      value: function removeWatcher() {
        var watcher = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
        this.watchers.remove(watcher);
      }
    }, {
      key: "depend",
      value: function depend() {
        if (Dep.target) {
          Dep.target.addDep(this);
        }
      }
    }, {
      key: "notify",
      value: function notify() {
        var subs = this.watchers.slice();
        subs.forEach(function (watcher) {
          return watcher.update();
        });
      }
    }]);

    return Dep;
  }();
  Dep.target = null;
  var targetStack = [];
  function pushTarget(watcher) {
    targetStack.push(watcher);
    Dep.target = watcher;
  }
  function popTarget(watcher) {
    targetStack.pop(watcher);
    Dep.target = targetStack[targetStack.length - 1];
  }

  var WatcherList = function () {
    function WatcherList() {
      _classCallCheck(this, WatcherList);

      this.list = [];
    }

    _createClass(WatcherList, [{
      key: "has",
      value: function has(watcher) {
        return this.list.some(function (item) {
          return item.id === watcher.id;
        });
      }
    }, {
      key: "add",
      value: function add(watcher) {
        this.list.push(watcher);
      }
    }, {
      key: "slice",
      value: function slice() {
        return this.list.slice();
      }
    }, {
      key: "remove",
      value: function remove(watcher) {
        this.list = this.list.filter(function (item) {
          return item.id !== watcher.id;
        });
      }
    }]);

    return WatcherList;
  }();

  // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
  _export(_export.S, 'Object', { create: _objectCreate });

  var $Object$2 = _core.Object;
  var create = function create(P, D) {
    return $Object$2.create(P, D);
  };

  var create$1 = create;

  var arrayOrgProto = Array.prototype;

  var arrayNewProto = create$1(arrayOrgProto);

  var arrayMap = ['push', 'pop', 'shift', 'unshift', 'splice', 'sort', 'reverse'];
  arrayMap.forEach(function (method) {
    var original = arrayNewProto[method];
    def$2(arrayNewProto, method, function () {
      for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }

      var result = original.apply(this, args);
      var ob = this.__ob__;
      var inserted = null;

      switch (method) {
        case 'push':
        case 'unshift':
          inserted = args;
          break;

        case 'splice':
          inserted = args.slice(2);
          break;
      }

      if (inserted) {
        ob.observeArray(inserted);
      }

      ob.dep.notify();
      return result;
    });
  });
  var arrayMethods = arrayNewProto;

  function observer(value) {
    if (!isArray(value) && !isPureObject(value)) {
      return void 0;
    }

    if (value.hasOwnProperty('__ob__') && value.__ob__ instanceof Observer$2) {
      return value.__ob__;
    }

    if (isExtensible$1(value)) {
      return new Observer$2(value);
    }

    return void 0;
  }

  var Observer$2 = function () {
    function Observer(value) {
      _classCallCheck(this, Observer);

      this.value = value;
      this.dep = new Dep();
      def$2(value, '__ob__', this);

      if (isArray(value)) {
        value.__proto__ = arrayMethods;
        this.observeArray(value);
        return void 0;
      }

      if (isPureObject(value)) {
        keys$1(value).forEach(function (key) {
          return defineReactive(value, key);
        });

        return void 0;
      }

      warn("value\u503C\uFF1A".concat(value, ",\u4E0D\u662F\u5BF9\u8C61\u65E0\u6CD5\u5B8C\u6210\u54CD\u5E94\u5F0F\u5904\u7406\u3002"));
    }

    _createClass(Observer, [{
      key: "observeArray",
      value: function observeArray(arr) {
        for (var i = 0, l = arr.length; i < l; ++i) {
          observer(arr[i]);
        }
      }
    }]);

    return Observer;
  }();

  function defineReactive(obj, key) {
    var property = getOwnPropertyDescriptor$1(obj, key);

    if (property && property.configurable === false) {
      warn("\u5BF9\u8C61".concat(obj, "\u7684\u5C5E\u6027").concat(key, "\u5DF2\u8BBE\u7F6E\u4E0D\u53EF\u4FEE\u6539\u63CF\u8FF0\u914D\u7F6E\uFF0C\u65E0\u6CD5\u8BBE\u7F6E\u54CD\u5E94\u5F0F\u6570\u636E\u3002"));
      return void 0;
    }

    var dep = new Dep();
    var getter = property && property.get;
    var setter = property && property.set;
    var val = obj[key];
    var childOb = observer(val);

    defineProperty$1(obj, key, {
      configurable: true,
      enumerable: true,
      get: function get() {
        var value = getter ? getter.call(obj) : val;

        if (Dep.target) {
          dep.depend();

          if (childOb) {
            childOb.dep.depend();
          }
        }

        return value;
      },
      set: function set(newVal) {
        var value = getter ? getter.call(obj) : val;

        if (newVal === value || newVal !== newVal && value !== value) {
          return void 0;
        }

        if (setter) {
          setter.call(obj, newVal);
        } else {
          val = newVal;
        }

        childOb = observer(newVal);
        dep.notify();
      }
    });
  }

  var watherAutoId = 0;
  var Watcher = function () {
    function Watcher() {
      var ctx = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
      var callback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : noop;
      var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};

      _classCallCheck(this, Watcher);

      if (ctx === null) {
        error("\u521B\u5EFAwatcher\u5931\u8D25\uFF0C\u6CA1\u6709\u63D0\u4F9B\u4E0A\u4E0B\u6587\u73AF\u5883context");
        return void 0;
      }

      this.id = watherAutoId++;
      this.ctx = ctx;
      this.deps = new DepList();
      this.newDeps = new DepList();
      this.trigger = isFunction(trigger) ? trigger : isString(trigger) ? parsePath(trigger) : noop;
      this.callback = isFunction(callback) ? callback : noop;
      this.isComputed = !!options.isComputed;
      this.cached = false;
      this.value = this.isComputed ? undefined : this.get();
    }

    _createClass(Watcher, [{
      key: "get",
      value: function get() {
        pushTarget(this);
        var value;

        try {
          value = this.trigger.call(this.ctx, this.ctx);
        } catch (e) {
          error("watcher.trigger\u6267\u884C\u9519\u8BEF: ".concat(e));
        } finally {
          popTarget();
        }

        this.cleanDeps();
        return value;
      }
    }, {
      key: "addDep",
      value: function addDep(dep) {
        if (!this.newDeps.has(dep)) {
          this.newDeps.add(dep);
        }

        if (!this.deps.has(dep)) {
          dep.addWatcher(this);
        }
      }
    }, {
      key: "depend",
      value: function depend() {
        var deps = this.deps.get();
        deps.forEach(function (dep) {
          return dep.depend();
        });
      }
    }, {
      key: "cleanDeps",
      value: function cleanDeps() {
        var oldDeps = this.deps.get();
        var newDeps = this.newDeps.get();

        var _iterator = _createForOfIteratorHelper(oldDeps),
            _step;

        try {
          for (_iterator.s(); !(_step = _iterator.n()).done;) {
            var it = _step.value;
            !this.newDeps.has(it) && it.removeWatcher(this);
          }
        } catch (err) {
          _iterator.e(err);
        } finally {
          _iterator.f();
        }

        this.deps.clear();
        this.deps.clone(newDeps);
        this.newDeps.clear();
      }
    }, {
      key: "update",
      value: function update() {
        if (this.isComputed) {
          this.cached = false;
        } else {
          this.run();
        }
      }
    }, {
      key: "run",
      value: function run() {
        var newVal = this.get();

        if (this.value !== newVal || isObject(newVal)) {
          var oldVal = this.value;

          try {
            this.callback.call(this.ctx, newVal, oldVal);
          } catch (e) {
            error("watcher.callback\u6267\u884C\u9519\u8BEF: ".concat(e));
          } finally {
            this.value = newVal;
          }
        }
      }
    }, {
      key: "evaluate",
      value: function evaluate() {
        if (this.cached) {
          return this.value;
        } else {
          this.cached = true;
          this.value = this.get();
          return this.value;
        }
      }
    }]);

    return Watcher;
  }();

  var DepList = function () {
    function DepList() {
      _classCallCheck(this, DepList);

      this.list = [];
    }

    _createClass(DepList, [{
      key: "has",
      value: function has(dep) {
        return this.list.some(function (item) {
          return item.id === dep.id;
        });
      }
    }, {
      key: "add",
      value: function add(dep) {
        this.list.push(dep);
      }
    }, {
      key: "get",
      value: function get() {
        return this.list.slice();
      }
    }, {
      key: "clone",
      value: function clone(depList) {
        this.list = depList;
      }
    }, {
      key: "clear",
      value: function clear() {
        this.list = [];
      }
    }]);

    return DepList;
  }();

  function isReserverd(key) {
    var list = ['__pk', '__data', '__options', '__computed', '__watch'];
    return list.indexOf(key) >= 0;
  }

  function proxy(obj, source, key) {
    defineProperty$1(obj, key, {
      configurable: true,
      enumerable: true,
      get: function get() {
        return obj[source][key];
      },
      set: function set(val) {
        obj[source][key] = val;
      }
    });
  }

  var Responsor = function () {
    function Responsor(options) {
      _classCallCheck(this, Responsor);

      if (!isPureObject(options)) {
        error("\u521B\u5EFA\u5931\u8D25\uFF0CResponsor\u53C2\u6570options\u5FC5\u987B\u4E3A\u7EAF\u5BF9\u8C61");
        return void 0;
      }

      def$2(this, '__pk', this);
      def$2(this, '__options', options);
      options.data && this.initData(options.data);
      options.watch && this.initWatch(options.watch);
      options.computed && this.initComputed(options.computed);
    }

    _createClass(Responsor, [{
      key: "initData",
      value: function initData(data) {
        def$2(this, '__data', data);

        if (!data || !isPureObject(data)) {
          warn("data\u89E3\u6790\u5931\u8D25, \u503C\u5E94\u8BE5\u4E3A\u7EAF\u5BF9\u8C61: ".concat(data));
          return void 0;
        }

        observer(data);

        for (var key in data) {
          if (data.hasOwnProperty(key) && !isReserverd(key)) {
            proxy(this, "__data", key);
          }
        }
      }
    }, {
      key: "initComputed",
      value: function initComputed(computed) {
        def$2(this, '__computed', {});
        def$2(this, '__computedwatchlist', {});

        if (!computed || !isPureObject(computed)) {
          warn("computed\u89E3\u6790\u5931\u8D25, \u503C\u5E94\u8BE5\u4E3A\u7EAF\u5BF9\u8C61: ".concat(computed));
          return void 0;
        }

        for (var key in computed) {
          if (!computed.hasOwnProperty(key)) {
            continue;
          }

          this.defineComputed(key, computed[key]);
        }
      }
    }, {
      key: "initWatch",
      value: function initWatch(watchers) {
        def$2(this, '__watch', watchers);

        if (!watchers || !isPureObject(watchers)) {
          warn("wathch\u89E3\u6790\u5931\u8D25, \u503C\u5E94\u8BE5\u4E3A\u7EAF\u5BF9\u8C61: ".concat(watchers));
          return void 0;
        }

        for (var key in watchers) {
          if (!watchers.hasOwnProperty(key)) {
            continue;
          }

          this.defineWatcher(key, watchers[key]);
        }
      }
    }, {
      key: "defineWatcher",
      value: function defineWatcher(key, handler) {
        if (!isString(key)) {
          warn("watch.".concat(key, "\u6CE8\u518C\u5931\u8D25: ").concat(key, "\u4E0D\u662F\u5B57\u7B26\u4E32"));
        }

        if (!isFunction(handler)) {
          warn("watch.".concat(key, "\u6CE8\u518C\u5931\u8D25: \u56DE\u8C03\u975E\u51FD\u6570"));
        }

        if (!this.hasOwnProperty(key) || isReserverd(key)) {
          warn("watch.".concat(key, "\u6CE8\u518C\u5931\u8D25\uFF0Ckey\u503C\u975E\u6CD5"));
        }

        new Watcher(this, key, handler);
      }
    }, {
      key: "defineComputed",
      value: function defineComputed(key, trigger) {
        if (!key || isReserverd(key)) {
          warn("computed:\u521B\u5EFA\u5931\u8D25 key:".concat(key, "\u503C\u4E3A\u975E\u6CD5\u503C"));
          return void 0;
        }

        if (this.__computed.hasOwnProperty(key)) {
          warn("computed:\u521B\u5EFA\u5931\u8D25 key:".concat(key, "\u503C\u5DF2\u5B58\u5728"));
          return void 0;
        }

        var watcher = new Watcher(this, trigger, noop, {
          isComputed: true
        });

        defineProperty$1(this, key, {
          configurable: true,
          enumerable: true,
          set: noop,
          get: function get() {
            if (watcher) {
              Dep.target && watcher.depend();
              return watcher.evaluate();
            }
          }
        });
      }
    }]);

    return Responsor;
  }();

  var CreateCollector = function () {
    function CreateCollector(ccLivePlayback) {
      _classCallCheck(this, CreateCollector);

      this.ccLivePlayback = ccLivePlayback;
      this.responsor = new Responsor({
        'data': {
          defaultMetaData: {
            animation: {},
            broadcast: {},
            chat: {},
            page: {},
            practice: {},
            qa: {},
            draw: {},
            laser: {},
            streamSourceRecord: {}
          },
          metaData: {
            animation: null,
            broadcast: null,
            chat: null,
            page: null,
            practice: null,
            qa: null,
            draw: null,
            streamSourceRecord: null
          },
          defaultStatus: {
            seeking: false
          },
          status: {
            seeking: null
          }
        },
        'watch': {},
        'computed': {
          computedSeeking: function computedSeeking() {
            return this.status.seeking || this.defaultStatus.seeking;
          },
          computedAnimation: function computedAnimation() {
            return this.metaData.animation || this.defaultMetaData.animation;
          },
          computedBroadcast: function computedBroadcast() {
            return this.metaData.broadcast || this.defaultMetaData.broadcast;
          },
          computedChat: function computedChat() {
            return this.metaData.chat || this.defaultMetaData.chat;
          },
          computedPage: function computedPage() {
            return this.metaData.page || this.defaultMetaData.page;
          },
          computedPractice: function computedPractice() {
            return this.metaData.practice || this.defaultMetaData.practice;
          },
          computedQA: function computedQA() {
            return this.metaData.qa || this.defaultMetaData.qa;
          },
          computedDraw: function computedDraw() {
            return this.metaData.draw || this.defaultMetaData.draw;
          },
          computedLaser: function computedLaser() {
            return this.metaData.laser || this.defaultMetaData.laser;
          },
          computedStreamSourceRecord: function computedStreamSourceRecord() {
            return this.metaData.streamSourceRecord || this.defaultMetaData.streamSourceRecord;
          }
        }
      });
    }

    _createClass(CreateCollector, [{
      key: "fork",
      value: function fork(flag) {
        if (flag === 'meta') {
          return {
            'animation': this.responsor.computedAnimation,
            'broadcast': this.responsor.computedBroadcast,
            'chat': this.responsor.computedChat,
            'page': this.responsor.computedPage,
            'practice': this.responsor.computedPractice,
            'qa': this.responsor.computedQA,
            'draw': this.responsor.computedDraw,
            'laser': this.responsor.computedLaser,
            'streamSourceRecord': this.responsor.computedStreamSourceRecord
          };
        } else if (flag === 'status') {
          return {
            'seeking': this.responsor.computedSeeking
          };
        }
      }
    }, {
      key: "set",
      value: function set(obj, name) {
        if (!obj || !isPureObject(obj)) return false;
        var target = this.responsor[name];

        var keys = keys$1(obj);

        return keys.reduce(function (result, key) {
          if (target.hasOwnProperty(key)) {
            var value = obj[key];

            if (isValidURLData(value)) {
              target[key] = value;
              return  result;
            } else {
              return false;
            }
          } else {
            return result;
          }
        }, true);
      }
    }]);

    return CreateCollector;
  }();

  function initCollector(ccLivePlayback) {
    def$2(ccLivePlayback, '_collector', new CreateCollector(ccLivePlayback));
    var collector = ccLivePlayback._collector;

    ccLivePlayback.setReplayStatus = function () {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      return collector.set(obj, 'defaultStatus');
    };

    ccLivePlayback.getReplayStatus = function () {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      collector.set(obj, 'status');
      return collector.fork('status');
    };

    ccLivePlayback.setMetaData = function () {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      return collector.set(obj, 'defaultMetaData');
    };

    ccLivePlayback.getMetaData = function () {
      var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
      collector.set(obj, 'metaData');
      return collector.fork('meta');
    };
  }

  var VERSION = '3.12.0';
  var DEVICETYPE = 'h5-pc';
  var TERMINAL = 3;
  var chatData = {
    beforeTime: 0,
    nextTime: 0,
    isSeek: false,
    msgs: {}
  };
  var bulletData = {
    container: null,
    h5TimeInterval: 0,
    cm: null,
    maxViewIsVideo: true
  };

  var container = bulletData.container,
      cm = bulletData.cm;
  var isIE9 = function isIE9() {
    if (navigator.userAgent.indexOf("compatible") > -1 && navigator.userAgent.indexOf("MSIE") > -1) {
      if (navigator.userAgent.indexOf("MSIE 9.0") > -1) {
        return "IE9";
      }

      if (navigator.userAgent.indexOf("MSIE 10.0") > -1) {
        return "IE10";
      }

      return true;
    }

    return false;
  };
  var isMp4 = function isMp4(url) {
    var l = url.split("?")[0];
    var u = l.slice(l.length - 4);
    return u === ".mp4";
  };
  function isShowBulletContent(val) {
    if (container) {
      if (cm) {
        cm.clear();
      }

      if (val) {
        container.show();
      } else {
        container.hide();
      }
    }
  }
  function getCurrentView() {
    {
      return callback.callbackPlayer;
    }
  }
  var checkVideo = function checkVideo() {
    if (document.createElement('video').canPlayType) {
      var vidTest = document.createElement('video');
      var oggTest = vidTest.canPlayType('video/ogg; codecs="theora, vorbis"');

      if (!oggTest) {
        var h264Test = vidTest.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');

        if (!h264Test) {
          return false;
        } else {
          if (h264Test === 'probably') {
            return true;
          } else {
            return false;
          }
        }
      } else {
        if (oggTest === 'probably') {
          return true;
        } else {
          return false;
        }
      }
    } else {
      return false;
    }
  };
  var getScript = function getScript(resourceUrl, callbackFn) {
    var script = document.createElement('script');
    script.src = resourceUrl;

    script.onload = script.onreadystatechange = function () {
      if (callbackFn && typeof callbackFn === 'function') {
        callbackFn();
      }
    };

    document.body.appendChild(script);
  };
  var loadScript = function loadScript(res, callback) {
    var resArray;

    if (res && typeof res === 'string') {
      var _res = res;
      resArray = [];
      resArray.push(_res);
    } else {
      resArray = res;
    }

    var queue = function queue(fs, cb) {
      getScript(fs.shift(), function () {
        fs.length ? queue(fs, cb) : cb && cb();
      });
    };

    queue(resArray, callback);
  };

  function isLivePlayerReady() {
    if (callback && callback.callbackPlayer && !callback.callbackPlayer.isReady) {
      setTimeout(function () {
        isLivePlayerReady();
      }, 500);
      return;
    }

    callback.drawPanel.intervalPainting(callback);
  }

  var initDrawPanelInfo = function initDrawPanelInfo() {
    if (!callback.isHistoryReady) {
      setTimeout(function () {
        initDrawPanelInfo();
      }, 300);
      return;
    }

    isLivePlayerReady();
  };

  var protocol = 'https://';
  var baseUrl = protocol + 'view.csslcloud.net';

  var ajax = function ajax() {
    var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
    var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
    var ops = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
    ops.type = (ops.type || 'GET').toUpperCase();
    ops.dataType = ops.dataType;
    ops.async = ops.async || true;
    ops.token = ops.token || '';
    var postQueryParams = ops.params;
    var xhr;

    if (window.XMLHttpRequest) {
      xhr = new XMLHttpRequest();
    } else {
      xhr = new ActiveXObject('Microsoft.XMLHTTP');
    }

    xhr.onreadystatechange = function () {
      if (xhr.readyState === 4) {
        var status = xhr.status;

        if (status >= 200 && status < 300) {
          ops.success && ops.success(xhr.responseText, xhr.responseXML);
        } else {
          ops.fail && ops.fail(status);
        }

        if (url.includes('/live/data') && DWLive) {
          var headers = xhr.getResponseHeader('Date');
          DWLive.timedifference = new Date(headers).getTime() - new Date().getTime();
        }
      }
    };

    if (ops.type === 'GET') {
      if (!objIsEmpty(data)) {
        var params = formatParams(data);
        xhr.open('GET', url + '?' + params, ops.async);
      } else {
        xhr.open('GET', url, ops.async);
      }

      if (ops.dataType && ops.dataType.toUpperCase() === 'JSON') {
        xhr.setRequestHeader('Content-Type', 'application/json');
      } else {
        xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      }

      if (ops.token) {
        xhr.setRequestHeader('X-HD-Token', ops.token);
      }

      xhr.send(null);
    } else if (ops.type === 'POST') {
      var _params2 = stringify$1(data);

      if (postQueryParams) {
        var _params3 = formatParams(postQueryParams);

        url = url + '?' + _params3;
      }

      xhr.open('POST', url, ops.async);

      if (ops.dataType && ops.dataType.toUpperCase() === 'JSON') {
        xhr.setRequestHeader('Content-Type', 'application/json');
      } else {
        xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
      }

      if (ops.token) {
        xhr.setRequestHeader('X-HD-Token', ops.token);
      }

      xhr.send(_params2);
    }
  };

  var practice = {
    getReplayPracticeInfo: function getReplayPracticeInfo(t) {
      t.tpl = initDW.tpl;
      $.ajax({
        url: '//eva.csslcloud.net/api/v1/practice/replay/info',
        data: t,
        type: "GET",
        dataType: "jsonp",
        timeout: 6000,
        success: function success(data) {
          window.on_hdReplay_practice_info && window.on_hdReplay_practice_info(data);
        },
        error: function error(_error) {
          window.on_hdReplay_practice_info && window.on_hdReplay_practice_info(_error);
        }
      });
    }
  };
  var httpGetPlayBackIntro = function httpGetPlayBackIntro(data, opt) {
    return ajax("".concat(baseUrl, "/replay/data/intro"), data, opt);
  };
  var httpPostLogin = function httpPostLogin(data, opt) {
    return ajax("".concat(baseUrl, "/replay/user/login"), data, opt);
  };
  var httpGetLogout = function httpGetLogout(data, opt) {
    return ajax("".concat(baseUrl, "/replay/user/logout"), data, opt);
  };
  var httpGetVideoUrl = function httpGetVideoUrl(data, opt) {
    return ajax("".concat(baseUrl, "/replay/video/play"), data, opt);
  };
  var httpGetMetaDate = function httpGetMetaDate(data, opt) {
    return ajax("".concat(baseUrl, "/replay/data/meta"), data, opt);
  };
  var httpGetCustomEmoji = function httpGetCustomEmoji(data, opt) {
    return ajax("".concat(baseUrl, "/replay/chat/emoji"), data, opt);
  };
  var httpGetReplayRule = function httpGetReplayRule(data, opt) {
    return ajax("".concat(baseUrl, "/api/replay/rule"), data, opt);
  };
  var httpGetReplayMark = function httpGetReplayMark(data, opt) {
    return ajax("".concat(baseUrl, "/replay/mark"), data, opt);
  };

  var DWDpc$1 = {
    isDPReady: false,
    dpc: {},
    fastMode: true,
    init: function init(opt) {
      if (!opt) return;
      this.dpc = new Dpc(opt);
    },
    appendDrawPanel: function appendDrawPanel() {
      var dp = '<iframe id="dpa" allow-scripts allowfullscreen allowusermedia frameborder="0" style="width: 100%;height:100%;"></iframe>';

      if (isMobile()) {
        dp = '<iframe id="dpa" allow-scripts allowfullscreen allowusermedia frameborder="0" style="width: 100%;height:100%;pointer-events: none;"></iframe>';
      }

      window.$('#playbackPanel').append(dp);

      if (typeof window.on_cc_live_db_flip === 'function') {
        window.on_cc_live_db_flip();
      }
    },
    destroy: function destroy() {
      this.clear();

      try {
        this.dpc.dispose();
        this.dpc.resetDpc();
        window.$("#dpa").remove();
      } catch (e) {
        console.log(e);
      }
    },
    pageChange: function pageChange(pc) {
      if (!this.isDPReady) return;

      if (!this.fastMode) {
        return;
      }

      this.dpc.pageChange(pc);
    },
    animationChange: function animationChange(ac) {
      if (!this.isDPReady) return;

      if (!this.fastMode) {
        return;
      }

      this.dpc.animationChange(ac);
    },
    history: function history(h) {
      if (!this.isDPReady) return;

      if (!this.fastMode) {
        return;
      }

      this.dpc.history(h);
    },
    drawNoCache: function drawNoCache(d) {
      if (!this.isDPReady) return;

      if (!this.fastMode) {
        return;
      }

      this.dpc.drawNoCache(d);
    },
    draw: function draw(d) {
      if (!this.isDPReady) return;

      if (!this.fastMode) {
        return;
      }

      this.dpc.draw(d);
    },
    drawNoCutting: function drawNoCutting(d) {
      if (!this.isDPReady) return;

      if (!this.fastMode) {
        return;
      }

      this.dpc.drawNoCutting(d);
    },
    clear: function clear() {
      if (!this.isDPReady) return;

      if (!this.fastMode) {
        return;
      }

      this.dpc.clear();
    },
    docAdapt: function docAdapt(t) {
      if (!this.isDPReady) return;

      if (!this.fastMode) {
        return;
      }

      var displayMode = t ? '1' : '2';
      this.dpc.setDisplayMode(displayMode);
    },
    showMarquee: function showMarquee(m) {
      if (!this.isDPReady) {
        return;
      }

      if (!this.fastMode) {
        return;
      }

      this.dpc.openMarquee(m);
    },
    closeMarquee: function closeMarquee() {
      if (!this.isDPReady) {
        return;
      }

      if (!this.fastMode) {
        return;
      }

      this.dpc.closeMarquee();
    }
  };
  window.DWDpc = DWDpc$1;

  var $parseFloat = _global.parseFloat;
  var $trim$1 = _stringTrim.trim;

  var _parseFloat = 1 / $parseFloat(_stringWs + '-0') !== -Infinity ? function parseFloat(str) {
    var string = $trim$1(String(str), 3);
    var result = $parseFloat(string);
    return result === 0 && string.charAt(0) == '-' ? -0 : result;
  } : $parseFloat;

  // 18.2.4 parseFloat(string)
  _export(_export.G + _export.F * (parseFloat != _parseFloat), { parseFloat: _parseFloat });

  var _parseFloat$1 = _core.parseFloat;

  var _parseFloat$2 = _parseFloat$1;

  var CallbackPlayer = function CallbackPlayer(opts) {
    this.isReady = false;
    this.qualityRate = 0;
    this.isPublishing = 0;
    this.id = opts.callbackPlayer.id;
    this.useHls = true;
    this.report = null;
    this.playbackRateValue = 1;
    this.beforeSeekStatus = null;
    this.videoSeek = false;
    this.playerTime = -1;
    this.seekingTime = 0;
    this.playerSeekType = 'front';
    var swfUrl = '//player.csslcloud.net/platform/live/CallbackPlayer.swf';
    var flashvars = {
      "userid": opts.userId,
      "videoid": opts.videoId,
      "recordid": opts.recordId,
      "isShowBar": opts.isShowBar,
      'roomid': opts.roomId,
      'upid': opts.upId,
      'viewerid': opts.viewerId
    };
    var params = {
      allowFullscreen: 'true',
      allowScriptAccess: 'always',
      wmode: 'transparent'
    };

    this.flashPlayerInit = function () {
      swfobject.embedSWF(swfUrl, opts.callbackPlayer.id, opts.callbackPlayer.width, opts.callbackPlayer.height, '10.0.0', '/flash/expressInstall.swf', flashvars, params);

      if (!isMobile()) {
        var report = new ReportLog(opts, 0, 1, null, false);
      }
    };

    if (initDW.isH5play) {
      if (isIE9()) {
        opts.isMp4 = 1;
        this.useHls = false;
        initDW.getH5src(opts);
      } else {
        var script = document.createElement("script");
        script.src = "https://p.bokecc.com/js/player/hls.js?v=1";

        script.onload = function () {
          this.useHls = true;
          initDW.getH5src(opts);
        };

        document.body.appendChild(script);
      }
    } else {
      this.flashPlayerInit();
    }

    var catonCount = 0;
    var catonDuration = 0;
    var catonTime = 0;
    var ccTrackCount = 0;
    var isCaton = false;
    var HEART_BEAT = 60000;
    var isSeeking = false;
    var isFrist = true;
    var ccTrackTiming = 0;
    var isEnd = false;
    var ccTrackTimer;

    var ccTrackTimerFoo = function ccTrackTimerFoo() {
      if (ccTrackTimer) {
        clearInterval(ccTrackTimer);
        ccTrackTimer = null;
      }

      ccTrackTimer = setInterval(function () {
        if (isEnd) return;

        try {
          var _catonInfo;

          ccTrackCount = ccTrackCount + 1;

          if (isCaton) {
            blockduration = catonDuration + (new Date().getTime() - startCatonTime);
          }

          if (catonDuration >= 60000) {
            isCaton = false;
          }

          var catonInfo = (_catonInfo = {
            event: 'heartbeat',
            code: 200,
            blocktimes: catonCount,
            blockduration: catonDuration >= 60000 ? 0 : catonDuration,
            rid: new Date().getTime(),
            num: ccTrackCount,
            heartinter: 60
          }, _defineProperty(_catonInfo, "rid", new Date().getTime()), _defineProperty(_catonInfo, "cdn", $('#playbackVideo').attr('src')), _catonInfo);
          catonCount = 0;
          catonDuration = 0;
          ccTrackTiming = new Date().getTime();
          ccTrack.tragger(catonInfo);
        } catch (error) {}
      }, HEART_BEAT);
    };

    this.addStyle = function () {
      var videoStyle = document.createElement('style');
      var styleSheet = "\n            .cc-video-player * {\n                box-sizing: border-box;\n            }\n            .cc-video-cover {\n                width: 100%;\n                height: 100%;\n                position: absolute;\n                z-index: 1000;\n                top: 0;\n                left: 0;\n                background-repeat: no-repeat;\n                background-size: auto 100%;\n                background-position: center center;\n                border-radius: 8px 8px 0 0;\n            }\n            .cc-video-cover .mask {\n                position: absolute;\n                width: 100%;\n                height: 100%;\n                left: 0;\n                top: 0;\n                background: #00101b;\n                opacity: .5;\n                pointer-events: none;\n                border-radius: 8px 8px 0 0;\n            }\n            .cc-video-cover .cc-video-content {\n                width: 150px;\n                height: 50px;\n                position: absolute;\n                text-align: center;\n                font-size: 12px;\n                color: #fff;\n                left: 50%;\n                margin-left: -75px;\n                top: 50%;\n                margin-top: -25px;\n                border-radius: 8px 8px 0 0;\n            }\n            .cc-video-cover .cc-video-content .cc-btn-play-h5 {\n                width: 50px;\n                height: 50px;\n                background: url('//static.csslcloud.net/view_replay/assets/img/mobile/cc-btn-play-m_5516d28d.png') no-repeat;\n                background-size: 100%;\n                background-color: #FF9502;\n                border-radius: 50%;\n                display: inline-block;\n            }\n            .cc_free_end {\n                position: absolute;\n                width: 100%;\n                height: 100%;\n                left: 0px;\n                top: 0px;\n                z-index: 336;\n                overflow: hidden; \n                background: rgba(0, 0, 0, .6); \n                text-align: center;\n                box-sizing: border-box;\n                display: flex;\n                justify-content: center;\n                align-items: center;\n                color: #fff;\n                font-size: 14px;\n                pointer-events: none;\n            }\n            .ccplayer-play-btn{\n                width: 30px;\n                height: 30px;\n                background: url('//static.csslcloud.net/view_replay/assets/img/mobile/cc-btn-play-m_5516d28d.png') no-repeat;\n                background-size:100%;\n                margin: 11px auto;\n                cursor: pointer;\n            }\n            .ccplayer-loading{display:none; color:#fff;width:100%;height:100%;justify-content: center;align-items: center;font-size:14px;position: absolute;z-index: 30;pointer-events: none;}\n            .ccplayer-loading-icon {width:120px;height:40px;text-align:center;line-height:40px;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);}\n            .ccplayer-loading-icon .ccplayer-loading-dot{-webkit-animation: ccplayer-loading-dot-fade .8s ease infinite;animation: ccplayer-loading-dot-fade .8s ease infinite;opacity: 0;transform-origin: 4px 4px}\n            .ccplayer-loading-icon .ccplayer-loading-dot.ccplayer-loading-dot-7 {-webkit-animation-delay: .7s;animation-delay: .7s}\n            .ccplayer-loading-icon .ccplayer-loading-dot.ccplayer-loading-dot-6 {-webkit-animation-delay: .6s;animation-delay: .6s}\n            .ccplayer-loading-icon .ccplayer-loading-dot.ccplayer-loading-dot-5 {-webkit-animation-delay: .5s;animation-delay: .5s}\n            .ccplayer-loading-icon .ccplayer-loading-dot.ccplayer-loading-dot-4 {-webkit-animation-delay: .4s;animation-delay: .4s}\n            .ccplayer-loading-icon .ccplayer-loading-dot.ccplayer-loading-dot-3 {-webkit-animation-delay: .3s;animation-delay: .3s}\n            .ccplayer-loading-icon .ccplayer-loading-dot.ccplayer-loading-dot-2 {-webkit-animation-delay: .2s;animation-delay: .2s}\n            .ccplayer-loading-icon .ccplayer-loading-dot.ccplayer-loading-dot-1 {-webkit-animation-delay: .1s;animation-delay: .1s}\n            @-webkit-keyframes ccplayer-loading-dot-fade {\n            0% {opacity: .7;transform: scale(1.2)}\n            50% {opacity: .25;transform: scale(.9)}\n            to {opacity: .25;transform: scale(.85)}\n            }\n            @keyframes ccplayer-loading-dot-fade {\n            0% {opacity: .7;transform: scale(1.2)}\n            50% {opacity: .25;transform: scale(.9)}\n            to {opacity: .25;transform: scale(.85)}\n            }\n        ";

      try {
        videoStyle.appendChild(document.createTextNode(styleSheet));
      } catch (err) {
        videoStyle.styleSheet.cssText = styleSheet;
      }

      var head = document.getElementsByTagName('head')[0];
      head.appendChild(videoStyle);
    }, this.h5playerInit = function (src, poster, showloading) {
      var _this = this;

      var v = '';
      var playBtnNode = '';
      var videoAttr = '';
      var logoUrl = '';
      var logoPositionStyle = '';
      var waitingDom = '';
      this.addStyle();

      if (initDW.videoLogo && initDW.videoLogo.img) {
        logoUrl = initDW.videoLogo.img;

        switch (initDW.videoLogo.position) {
          case 1:
            logoPositionStyle = 'display: block; font-size: 0; top: 0; right: 0;';
            break;

          case 2:
            logoPositionStyle = 'display: block; font-size: 0; bottom: 0; right: 0;';
            break;

          case 3:
            logoPositionStyle = 'display: block; font-size: 0; top: 0; left: 0;';
            break;

          case 4:
            logoPositionStyle = 'display: block; font-size: 0; bottom: 0; left: 0;';
            break;

          default:
            logoPositionStyle = 'display: block; font-size: 0; top: 0; right: 0;';
            break;
        }
      }

      if (isMobile()) {
        playBtnNode = "<span id=\"cc_player_play_btn\" class=\"cc-btn-play-h5\"></span>";

        if (isAndroid()) {
          videoAttr = "x5-video-player-type=\"h5-page\" webkit-playsinline playsinline x-webkit-airplay=\"allow\"";
        } else {
          videoAttr = "webkit-playsinline playsinline x5-playsinline x-webkit-airplay=\"allow\"";
        }
      } else {
        playBtnNode = "<div id=\"cc_player_play_btn\" onclick=\"$.DW.play()\" class=\"ccplayer-play-btn\">\n            </div>";
        videoAttr = "webkit-playsinline playsinline x5-playsinline autoplay x-webkit-airplay=\"deny\"";
      }

      waitingDom = '<span class="ccplayer-loading-icon"><svg style="width:100%;height:100%;fill:#fff" version="1.1" viewBox="0 0 22 22"><svg x="7" y="1"><circle class="ccplayer-loading-dot ccplayer-loading-dot-0" cx="4" cy="4" r="2"></circle></svg><svg x="11" y="3"><circle class="ccplayer-loading-dot ccplayer-loading-dot-1" cx="4" cy="4" r="2"></circle></svg><svg x="13" y="7"><circle class="ccplayer-loading-dot ccplayer-loading-dot-2" cx="4" cy="4" r="2"></circle></svg><svg x="11" y="11"><circle class="ccplayer-loading-dot ccplayer-loading-dot-3" cx="4" cy="4" r="2"></circle></svg><svg x="7" y="13"><circle class="ccplayer-loading-dot ccplayer-loading-dot-4" cx="4" cy="4" r="2"></circle></svg><svg x="3" y="11"><circle class="ccplayer-loading-dot ccplayer-loading-dot-5" cx="4" cy="4" r="2"></circle></svg><svg x="1" y="7"><circle class="ccplayer-loading-dot ccplayer-loading-dot-6" cx="4" cy="4" r="2"></circle></svg><svg x="3" y="3"><circle class="ccplayer-loading-dot ccplayer-loading-dot-7" cx="4" cy="4" r="2"></circle></svg></svg></span>';
      v = "<div id=\"cc_player_logo\" style=\"display: none; pointer-events: none; position: absolute; width: 20%; overflow:hidden; z-index: 335; ".concat(logoPositionStyle, "\">\n            <img style=\"width: 100%; display: block;\" src=\"").concat(logoUrl, "\" />\n        </div>\n        <div class=\"video-bullet\" id=\"bulletContainer\" style=\"position: absolute;left: 0px;top: 0px;z-index: 333;width: 100%;height: 100%;overflow:hidden;pointer-events: none;\"></div>\n        <div id=\"marquee\" style=\"width: 100%;height: 100%;position: absolute;z-index: 30;left: 0;top: 0;overflow:hidden;pointer-events: none;\"></div>\n        <div class=\"ccplayer-loading\" id=\"cc_video_loading\">").concat(waitingDom, "</div>\n        <div class=\"cc_free_end\" id=\"cc_free_end\" style=\"display: none;\"><span class=\"cc-video-loading-text\">\u8BD5\u770B\u5DF2\u7ED3\u675F</span></div>\n        <div id=\"cc-video-cover\" class=\"cc-video-cover\" style=\"background-image:url(").concat(poster, ");\">\n            <div class=\"mask\">\n            </div>\n            <div id=\"cc-video-content\" class=\"cc-video-content\">\n                ").concat(playBtnNode, "\n            </div>\n        </div>\n        <video id=\"playbackVideo\" ").concat(videoAttr, " crossOrigin=\"anonymous\" width=\"100%\" height=\"100%\" controls controlslist=\"nodownload\"></video>\n        ");
      $('#playbackPlayer').html(v);
      var startPlayTime = new Date().getTime();
      var h5Video = document.getElementById('playbackVideo');
      if (!h5Video) return;
      var playBtn = document.getElementById('cc_player_play_btn');
      var videoCover = document.getElementById('cc-video-cover');
      videoCover.addEventListener('click', function (event) {
        event.stopPropagation();
        event.preventDefault();
      }, false);
      playBtn.addEventListener('click', function () {
        videoCover.style.display = 'none';

        _this.play();
      }, false);

      if (showloading) {
        var loadingNode = document.getElementById("cc_video_loading");
        loadingNode.style.display = 'block';
      }

      if (callback.changeVideoQualityStatus === 1) {
        var videoPoster = h5Video.parentNode ? h5Video.parentNode.querySelector(".cc-video-cover") : null;

        if (videoPoster && videoPoster.style.display !== 'none') {
          videoPoster.style.display = 'none';
        }
      }

      if (opts.isShowBar) {
        h5Video.removeAttribute('controls');
      }

      if (this.useHls && !isMp4(src)) {
        if (Hls.isSupported()) {
          var oVsrc = src;
          var hls = new Hls();
          hls.loadSource(oVsrc);
          hls.attachMedia(h5Video);
          _this.hls = hls;

          _this.hls.on(Hls.Events.MEDIA_ATTACHED, function () {
            _this.hls.loadSource(src);
          });

          _this.hls.on(Hls.Events.MANIFEST_PARSED, function () {
            h5Video.play();
          });
        } else {
          $('#playbackVideo').attr('src', src);
        }
      } else {
        $('#playbackVideo').attr('src', src);
      }

      var terminal = 0;
      var ua = 1;

      if (isMobile()) {
        terminal = 1;
        ua = 11;
      }

      this.report = new ReportLog(opts, terminal, ua, h5Video);

      h5Video.onerror = function () {
        try {
          var errorInfo = {
            event: 'play',
            code: 400,
            rid: new Date().getTime(),
            cdn: $('#playbackVideo').attr('src')
          };
          ccTrack.tragger(errorInfo);
        } catch (error) {}
      };

      window.on_cc_player_ready && window.on_cc_player_ready();
      h5Video.addEventListener('canplay', function () {
        initDW.replayMark();
        window.on_cc_live_player_ready && window.on_cc_live_player_ready();
        window.on_cc_live_player_init && window.on_cc_live_player_init();
      }, false);
      h5Video.addEventListener('timeupdate', function () {
        if (!isSeeking) _this.playerTime = _parseInt$2(this.currentTime);
        var playStatus = initDW.getReplayStatus();

        if (playStatus.seeking !== true) {
          var _callback, _callback$drawPanel;

          _this.seekingTime = 0;
          initDW.beforeSeekTime = -1;
          initDW.seekTime = -1;
          (_callback = callback) === null || _callback === void 0 ? void 0 : (_callback$drawPanel = _callback.drawPanel) === null || _callback$drawPanel === void 0 ? void 0 : _callback$drawPanel.interval(this.currentTime);
        }

        var loadingNode = document.getElementById("cc_video_loading");

        if (!isSeeking && loadingNode && loadingNode.style.display != 'none') {
          loadingNode.style.display = 'none';
        }

        var videoPoster = h5Video.parentNode ? h5Video.parentNode.querySelector(".cc-video-cover") : null;

        if (videoPoster && videoPoster.style.display !== 'none') {
          videoPoster.style.display = 'none';
        }

        if (initDW.trialDuration) {
          var finish = _this.handleFreetime(h5Video);

          if (finish) return;
        }

        if (callback && callback.currentTime > 0 && callback.changeVideoQualityStatus === 1) {
          _this.seek(callback.currentTime);

          _this.setVolume(callback.curVolume);

          _this.playbackRate(callback.curRate);

          callback.changeVideoQualityStatus = 0;
        }

        if (this.currentTime > 3) {
          localStorage.setItem(opts.recordId, Math.floor(this.currentTime));
        }
      }, false);
      h5Video.addEventListener('waiting', function () {
        var loadingNode = document.getElementById("cc_video_loading");
        loadingNode.style.display = 'block';
        if (isSeeking) return;
        catonCount = catonCount + 1;
        isCaton = true;

        if (isCaton) {
          catonTime = new Date().getTime();
        }
      });
      h5Video.addEventListener('playing', function () {
        var loadingNode = document.getElementById("cc_video_loading");

        if (loadingNode && loadingNode.style.display != 'none') {
          loadingNode.style.display = 'none';
        }

        if (initDW.trialDuration) {
          var finish = _this.handleFreetime(h5Video);

          if (finish) return;
        }

        var endPlayTime = new Date().getTime();

        if (isFrist) {
          isFrist = false;
          ccTrackTimerFoo();

          try {
            var et;

            if (window.clickPlayerStartTime) {
              et = endPlayTime - window.clickPlayerStartTime;
            } else {
              et = endPlayTime - startPlayTime;
            }

            var etInfo = {
              event: 'play',
              et: et,
              code: 200,
              rid: new Date().getTime(),
              cdn: $('#playbackVideo').attr('src')
            };
            ccTrack.tragger(etInfo);
          } catch (error) {}
        } else if (isCaton) {
          isCaton = false;

          if (catonCount === 0) {
            catonCount = catonCount + 1;
            catonDuration = catonDuration + (new Date().getTime() - ccTrackTiming);
          } else {
            catonDuration = catonDuration + (new Date().getTime() - catonTime);
          }
        }

        _this.pauseState = false;
        window.on_player_start && window.on_player_start();
        window.on_spark_player_resume && window.on_spark_player_resume();
      }, false);
      h5Video.addEventListener('play', function () {
        initDW.emit('play');
      }, false);
      h5Video.addEventListener('pause', function () {
        _this.pauseState = true;
        initDW.emit('pause');
        window.on_spark_player_pause && window.on_spark_player_pause();
      }, false);
      h5Video.addEventListener('ended', function () {
        isEnd = true;
        window.on_spark_player_end && window.on_spark_player_end();
      }, false);
      h5Video.addEventListener('seeking', function () {
        isSeeking = true;
        _this.seekingTime = _parseInt$2(this.currentTime);
        if (_this.seekingTime < _this.playerTime) _this.playerSeekType = 'back';
        console.log('seeking----', _this.seekingTime, _this.playerTime, _this.playerSeekType);

        if (initDW.trialDuration) {
          var finish = _this.handleFreetime(h5Video);

          if (finish) return;
        }

        if (opts.isShowBar === 0 && !_this.videoSeek && !initDW.seekType) {
          console.log('调用seek', initDW.seekType);
          _this.videoSeek = true;
          $.DW.seek(this.currentTime);
        }

        var loadingNode = document.getElementById("cc_video_loading");
        loadingNode.style.display = 'block';
        seekStart && seekStart();
      }, false);
      h5Video.addEventListener('seeked', function () {
        console.log('seeked----', this.currentTime, initDW.getReplayStatus().seeking);
        localStorage.setItem(opts.recordId, Math.floor(this.currentTime));
        isSeeking = false;
        var loadingNode = document.getElementById("cc_video_loading");

        if (loadingNode && loadingNode.style.display != 'none') {
          loadingNode.style.display = 'none';
        }

        seekComplete && seekComplete();
        _this.videoSeek = false;
        initDW.seekType = '';
        _this.playerSeekType = 'front';
        _this.seekingTime = 0;
      }, false);
      h5Video.addEventListener('error', function () {}, false);
    };

    this.handleFreetime = function (player) {
      var tips = document.getElementById("cc_free_end");

      if (_parseInt$2(player.currentTime) >= initDW.trialDuration) {
        if (_parseInt$2(player.currentTime) > initDW.trialDuration) {
          this.seek(initDW.trialDuration);
        }

        player.pause();
        tips.style.display = 'flex';
        window.on_cc_player_freetime_end && window.on_cc_player_freetime_end();
        return true;
      } else {
        tips.style.display = 'none';
      }

      return false;
    };

    this.getFlash = function () {
      return swfobject.getObjectById(this.id);
    };

    this.getH5player = function () {
      return $('#playbackVideo')[0];
    };

    this.playbackRate = function (t) {
      if (!initDW.isH5play && isMobile()) {
        return;
      }

      var t = _parseFloat$2(t);

      this.playbackRateValue = t;
      this.getH5player().playbackRate = t;
    };

    this.seek = function (t) {
      if (t < 0) {
        return;
      }

      if (this.getH5player().paused || this.getH5player().currentTime === 0) {
        this.beforeSeekStatus = 'pause';
      } else {
        this.beforeSeekStatus = 'play';
      }

      if (initDW.h5canPlay) {
        this.getH5player().currentTime = t;
        if (this.beforeSeekStatus === 'play') this.getH5player().pause();
      } else {
        var swf = this.getFlash();

        if (!swf) {
          return;
        }

        swf.seek(t);
      }
    };

    this.showMarquee = function (m) {
      if (!m) return;

      if (initDW.h5canPlay) {
        if (!this.marquee) {
          this.loadMarqueePlugin('//static.csslcloud.net/js/marquee.js', m);
        } else {
          this.marquee.startTimerToRun();
        }

        return;
      }

      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      swf._showMarqueePlugin(m);
    };

    this.closeMarquee = function () {
      if (!this.isReady) {
        return;
      }

      if (initDW.h5canPlay) {
        if (this.marquee) {
          this.marquee.close();
        }

        return;
      }

      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      swf.closePlugin('marquee');
    };

    this.loadMarqueePlugin = function (url, data) {
      if (!url) {
        return;
      }

      var script = document.createElement('script');
      script.src = url;
      script.type = 'text/javascript';

      script.onload = function () {
        this.marquee = new MarqueePlugin();

        try {
          this.marquee.init(JSON.parse(data));
        } catch (e) {}
      }.bind(this);

      document.body.appendChild(script);
    };

    this.showBulletCurtain = function (obj) {
      if (!this.isReady) {
        return;
      }

      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      swf.showBulletCurtain(obj);
    };

    this.addBullet = function (msg) {
      if (!this.isReady) {
        return;
      }

      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      swf.addBullet(msg);
    };

    this.setBulletCurtainVisible = function (val) {
      if (!this.isReady) {
        return;
      }

      if (initDW.isH5play) {
        isShowBulletContent(val);
        return;
      }

      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      swf.setBulletCurtainVisible(val);
    };

    this.switchFullScreen = function (b) {
      if (initDW.isH5play || isMobile()) {
        if (b) {
          if (this.getH5player().requestFullscreen) {
            this.getH5player().requestFullscreen();
          } else if (this.getH5player().mozRequestFullScreen) {
            this.getH5player().mozRequestFullScreen();
          } else if (this.getH5player().msRequestFullscreen) {
            this.getH5player().msRequestFullscreen();
          } else if (this.getH5player().webkitSupportsFullscreen) {
            this.getH5player().webkitEnterFullscreen();
          }
        } else {
          if (this.getH5player().exitFullscreen) {
            this.getH5player().exitFullscreen();
          } else if (this.getH5player().msExitFullscreen) {
            this.getH5player().msExitFullscreen();
          } else if (this.getH5player().mozExitFullScreen) {
            this.getH5player().mozExitFullScreen();
          } else if (this.getH5player().webkitExitFullscreen) {
            this.getH5player().webkitExitFullscreen();
          } else if (document.mozCancelFullScreen) {
            document.mozCancelFullScreen();
          }
        }
      }
    };

    this.getPlayerTime = function () {
      if (!this.getH5player()) {
        return 0;
      }

      var t;

      if (initDW.h5canPlay || initDW.isH5play) {
        t = this.getH5player().currentTime;
        t = Math.floor(t);
      } else {
        t = _parseInt$2(this.getFlash().getPosition(), 10);
      }

      if (isNaN(t) || t < 0) {
        return 0;
      }

      return t;
    };

    this.getDuration = function () {
      if (initDW.h5canPlay && this.getH5player()) {
        try {
          return Math.floor(this.getH5player().duration);
        } catch (error) {
          return 0;
        }
      } else {
        var swf = this.getFlash();

        if (!swf) {
          return 0;
        }

        return swf.getDuration();
      }
    };

    this.getBuffer = function () {
      if (initDW.isH5play || isMobile()) {
        if (!this.getH5player() || !this.getH5player().buffered.length > 0 || !this.getH5player().buffered || !this.getH5player().buffered.end || !this.getH5player().buffered.end(0)) {
          return 0;
        }

        try {
          var buffer = 0;
          var buffered = this.getH5player().buffered;
          var currentTime = this.getH5player().currentTime;

          for (var i = 0; i < buffered.length; i++) {
            if (currentTime < buffered.end(i)) {
              buffer = buffered.end(i);
              break;
            }
          }

          return buffer;
        } catch (error) {
          return 0;
        }
      } else {
        var swf = this.getFlash();

        if (!swf) {
          return;
        }

        try {
          return swf.getBufferLength();
        } catch (error) {
          return 0;
        }
      }
    };

    this.setHistoryPlayTime = function (time) {
      var t = _parseInt$2(time);

      if (t < 0) {
        return;
      }

      if (this.getH5player()) {
        this.getH5player().currentTime = t;
      } else {
        var swf = this.getFlash();

        if (!swf) {
          return;
        }

        swf.seek(t);
      }
    };

    this.getHistoryPlayTime = function () {
      var historyTime = localStorage.getItem(opts.recordId);

      if (historyTime && historyTime !== undefined && historyTime !== null) {
        return _parseInt$2(historyTime);
      }
    };

    this.setVolume = function (n) {
      if (initDW.isH5play || isMobile()) {
        this.getH5player().volume = _parseFloat$2(n);

        if (n === 0) {
          this.getH5player().muted = true;
        } else {
          this.getH5player().muted = false;
        }
      } else {
        var swf = this.getFlash();

        if (!swf) {
          return;
        }

        if (swf.setVolume) {
          return swf.setVolume(n);
        }

        return 0;
      }
    };

    this.getVolume = function () {
      if (initDW.isH5play || isMobile()) {
        return this.getH5player().volume;
      } else {
        var swf = this.getFlash();

        if (!swf) {
          return;
        }

        return swf.getVolume ? swf.getVolume() : 0;
      }
    };

    this.play = function () {
      if (initDW.isH5play || isMobile()) {
        if (initDW.trialDuration && this.getH5player().currentTime >= initDW.trialDuration) return;

        if (this.pauseState === undefined || this.getH5player().paused) {
          window.clickPlayerStartTime = new Date().getTime();
          this.getH5player().play();
          this.playbackRate(this.playbackRateValue);
        } else {
          this.getH5player().pause();
        }
      } else {
        var swf = this.getFlash();

        if (!swf) {
          return;
        }

        return swf.isPlay ? swf.isPlay() : 0;
      }
    };

    this.setZScale = function (s) {
      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      return swf.setZScale(s);
    };

    this.getZScale = function () {
      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      return swf.getZScale();
    };

    this.setScale = function (s) {
      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      return swf.setScale(s);
    };

    this.getScale = function () {
      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      return swf.getScale();
    };

    this.openSettingPanel = function () {
      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      return swf.openSettingPanel();
    };

    this.destroy = function () {
      if (this.hls) {
        this.hls.destroy();
        this.hls = null;
      }

      $("#playbackPlayer").children().remove();
      $("#playbackVideo").remove();
    };

    this.changeQuality = function (quality, callBack) {
      var currentQuality = callback.currentVideoQuality;
      if (quality === currentQuality) return;
      var recordVideoSource = callback.recordVideoSource;
      var poster = callback.vodeoPoster;
      var currentVideoSource = recordVideoSource.filter(function (item) {
        return item.code === quality;
      });
      if (currentVideoSource.length === 0) return;

      var currentTime = _parseInt$2(this.getPlayerTime());

      var curVolume = _parseInt$2(this.getVolume());

      var curRate = _parseInt$2(this.getH5player().playbackRate);

      callback.currentTime = currentTime;
      callback.curVolume = curVolume;
      callback.curRate = curRate;
      this.qualityRate = currentQuality;
      callback.changeVideoQualityStatus = 1;
      this.destroy();
      callback.currentVideoQuality = currentVideoSource[0].code;
      this.h5playerInit(currentVideoSource[0].primary, poster, 'showloading');
    };
  };

  var options$1 = {
    userId: $('#userId').val(),
    roomId: $('#roomId').val(),
    liveId: $('#liveId').val(),
    recordId: $('#recordId').val(),
    videoId: $('#videoId').val(),
    adapt: false,
    isShowBar: 0,
    viewerId: $('#viewerId').val(),
    upId: $('#upId').val(),
    viewer: {
      id: $('#viewerId').val(),
      name: $('#viewerName').val(),
      role: $('#viewerRole').val(),
      sessionId: $('#sessionId').val()
    },
    callbackPlayer: {
      id: 'playbackPlayer',
      width: '100%',
      height: '100%'
    },
    drawPanel: {
      id: 'playbackPanel',
      width: '100%',
      height: '100%'
    }
  };

  var Iterator = function () {
    function Iterator() {
      _classCallCheck(this, Iterator);

      this.middlewares = [];
      this.stop = false;
    }

    _createClass(Iterator, [{
      key: "use",
      value: function use(fn) {
        this.middlewares.push(fn);
        return this;
      }
    }, {
      key: "run",
      value: function run(ctx) {
        function createNext(middleware, oldNext) {
          return function () {
            middleware(ctx, oldNext);
          };
        }

        var len = this.middlewares.length;

        var next = function next() {};

        for (var i = len - 1; i >= 0; i--) {
          if (this.stop) break;
          var currentMiddleware = this.middlewares[i];
          next = createNext(currentMiddleware, next);
        }

        next();
      }
    }, {
      key: "clear",
      value: function clear() {
        this.stop = true;
        this.middlewares = [];
      }
    }]);

    return Iterator;
  }();

  var DrawPanel$1 = function DrawPanel(opts, callbackPlayer) {
    this.isReady = false;
    this.currentTime = -1;
    this.currentDrawTime = -1;
    this.currentGlobalDrawTime = 0;
    var swfUrl = '//zeus.csslcloud.net/flash/Player.swf';
    this.drawQueue = [];
    var flashvars = {
      'type': 'drawpanel'
    };
    var params = {
      allowFullscreen: 'true',
      allowScriptAccess: 'always',
      wmode: 'transparent'
    };
    var attributes = {};

    if (!DWDpc.fastMode) {
      swfobject.embedSWF(swfUrl, opts.drawPanel.id, opts.drawPanel.width, opts.drawPanel.height, '10.0.0', '/flash/expressInstall.swf', flashvars, params, attributes);
    }

    this.getFlash = function () {
      if (!this.isReady) {
        return;
      }

      return swfobject.getObjectById(opts.drawPanel.id);
    };

    this.clear = function () {
      DWDpc.clear();
      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      swf.clear();
    };

    this.orderDraw = function (drawArray) {
      var _this2 = this;

      var _this = this;

      var count = drawArray.length;
      var iterator = new Iterator();
      var interval = 0;
      if (count === 0) return;
      if (count > 1) interval = _parseInt$2(1000 / count);

      var _loop = function _loop(i) {
        var element = drawArray[i];
        var playStatus = initDW.getReplayStatus();

        _this2.drawQueue.push(element);

        iterator.use(function (ctx, next) {
          setTimeout(function () {
            var element = _this.drawQueue.shift();

            if (!callback || !callback.callbackPlayer || !element) {
              iterator.clear();
              return;
            }

            var curTime = callback.callbackPlayer.getPlayerTime();

            if (playStatus.seeking === true || element.time > curTime || initDW.beforeSeekTime > -1 && element.time === initDW.beforeSeekTime || initDW.seekTime > -1 && element.time > initDW.seekTime) {
              iterator.clear();
              return;
            }

            if (DWDpc.fastMode) {
              DWDpc.draw(element);
            } else {
              DWDpc.draw(element.data);
            }

            _this.currentDrawTime = element.time;
            next();
          }, interval);
        });
        if (playStatus.seeking === true) return "break";
      };

      for (var i = 0; i < count; i++) {
        var _ret = _loop(i);

        if (_ret === "break") break;
      }

      iterator.run();
    };

    this.seekDraw = function (j) {
      var _this3 = this;

      this.drawQueue.length = 0;
      j.forEach(function (ele) {
        if (ele.data.type === 10) return;
        DWDpc.drawNoCutting(ele);
        _this3.currentDrawTime = ele.time;

        var swf = _this3.getFlash();

        if (!swf) {
          return;
        }

        swf.draw(ele);
      });
    };

    this.draw = function (j, ft) {
      DWDpc.draw(j);
      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      swf.draw(j);
    };

    this.draws = function (js) {
      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      (function (jstr) {
        setTimeout(function () {
          swf.drawList(jstr);
        });
      })(js);
    };

    this.filp = function (j) {
      callback.currentPage = "".concat(j.docId, "_").concat(j.pageNum);
      DWDpc.pageChange(j);
      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      var jj = JSON.parse(j);
      var u = jj.url;
      var isHttps = window.location.protocol === 'https:';

      if (isHttps) {
        jj.url = u.replace(/http:/g, 'https:');
      }

      if (options.adapt) {
        swf.filp(stringify$1(jj), 'auto');
      } else {
        swf.filp(stringify$1(jj));
      }
    };

    this.animation = function (j) {
      setTimeout(function () {
        DWDpc.animationChange(j);
      }, 0);
      var swf = this.getFlash();

      if (!swf) {
        return;
      }

      swf.animation(j);
    };

    this.intervalNum = 0;

    this.interval = function (curTime) {
      var _this4 = this;

      var ft = 0;

      try {
        ft = curTime;
      } catch (e) {}

      if (ft < 0) {
        return;
      }

      if (this.currentTime === _parseInt$2(ft)) return;
      this.currentTime = _parseInt$2(ft);

      if (callback && callback.isRequestDraws) {
        callback.drawsInfoRequestPool.isHttpRequestCurrentDraws(ft, function (data) {
          callback.draws = data;
        });
      }

      try {
        if (callback.pageChanges && callback.pageChanges.length > 0) {
          if (callback.pageChangeIndex < callback.pageChanges.length) {
            var pc = callback.pageChanges[callback.pageChangeIndex + 1];

            if (ft >= pc.time) {
              if (typeof window.on_cc_callback_page_change === 'function') {
                window.on_cc_callback_page_change(pc);
              }

              if (typeof window.on_cc_request_snapshoot === 'function') {
                window.on_cc_request_snapshoot(pc);
              }

              if (DWDpc.fastMode) {
                this.filp(pc);
              } else {
                this.filp(stringify$1({
                  'fileName': pc.docName,
                  'totalPage': pc.docTotalPage,
                  'docid': pc.encryptDocId,
                  'url': pc.url,
                  'page': pc.pageNum,
                  'useSDK': pc.useSDK
                }));
              }

              callback.pageChangeIndex = callback.pageChangeIndex + 1;
              var obj = {};
              obj.docId = pc.docId;
              obj.docName = pc.docName;
              obj.docTotalPage = pc.docTotalPage;
              obj.pageNum = pc.pageNum;

              if (typeof window.on_cc_callback_pagechange === 'function') {
                window.on_cc_callback_pagechange(obj);
              }
            }
          }
        }
      } catch (e) {}

      try {
        if (callback.animations && callback.animations.length > 0) {
          if (callback.animationIndex < callback.animations.length) {
            var pidex = callback.pageChangeIndex;

            if (pidex >= 0) {
              var pc = callback.pageChanges[pidex];
              var a = callback.animations[callback.animationIndex + 1];

              if (!!pc && !!a && pc.encryptDocId == a.encryptDocId && ft >= a.time && pc.time <= a.time) {
                if (DWDpc.fastMode) {
                  this.animation(a);
                } else {
                  this.animation(stringify$1({
                    'fileName': a.docName,
                    'totalPage': a.docTotalPage,
                    'docid': a.encryptDocId,
                    'url': a.url,
                    'page': a.pageNum,
                    'step': a.step
                  }));
                }

                callback.animationIndex = callback.animationIndex + 1;
              }

              if (ft >= a.time && (a.time < pc.time || a.pageNum < pc.pageNum)) {
                callback.animationIndex = callback.animationIndex + 1;
              }
            }
          }
        }
      } catch (e) {}

      try {
        var key = callback.currentPage;
        var currentPageDraws = callback.newDraws[key];

        if (currentPageDraws && currentPageDraws[_parseInt$2(ft)]) {
          this.orderDraw(currentPageDraws[_parseInt$2(ft)]);
        }
      } catch (e) {}

      try {
        if (callback.globalDraws && callback.globalDraws.length > 0) {
          if (callback.globalDrawsIndex < callback.globalDraws.length) {
            var dc = callback.globalDraws[callback.globalDrawsIndex + 1];

            while (ft >= dc.time) {
              var arryFilter = dc.draws;
              arryFilter.forEach(function (element) {
                if (element.time === 0) return;
                _this4.currentGlobalDrawTime = element.time;

                if (DWDpc.fastMode) {
                  _this4.draw(element, ft);
                } else {
                  _this4.draw(element.data, ft);
                }
              });
              callback.globalDrawsIndex = callback.globalDrawsIndex + 1;
              dc = callback.globalDraws[callback.globalDrawsIndex + 1];
            }
          }
        }
      } catch (e) {}
    };

    this.destroy = function () {
      if (callback.drawPanel.intervalNum != -1) {
        clearInterval(callback.drawPanel.intervalNum);
      }
    };

    this.intervalPainting = function (callback) {
      if (callback.drawPanel.intervalNum != -1) {
        clearInterval(callback.drawPanel.intervalNum);
      }

      callback.drawPanel.interval(0);
    };
  };

  var Socket = function Socket(opts) {
    var isHttps = window.location.protocol === 'https:';
    var host = opts.chat.host;

    if (isHttps && host && host.indexOf(':')) {
      var s = host.split(':');

      if (s.length == 2) {
        var port = _parseInt$2(s[1]);

        if (!isNaN(port)) {
          var httpsPort = port + 400;
          host = s[0] + ':' + httpsPort;
        }
      }
    }

    var terminal = 0;

    if (isMobile()) {
      terminal = 1;
    }

    var socket;

    if (!initDW.forceNew) {
      socket = io.connect(document.location.protocol + '//' + host + '/replay', {
        query: {
          roomid: opts.roomId,
          sessionid: opts.viewer.sessionId,
          platform: 1,
          terminal: terminal,
          tpl: initDW.tpl
        }
      });
    } else {
      socket = io.connect(document.location.protocol + '//' + host + '/replay?roomid=' + opts.roomId + '&sessionid=' + opts.viewer.sessionId + '&platform=' + 1 + '&tpl=' + initDW.tpl + '&terminal=' + terminal, {
        forceNew: true
      });
    }

    socket.on('hd-live-start', function (data) {
      if (typeof window.on_cc_hd_live_start === 'function') {
        window.on_cc_hd_live_start(data);
      }
    });

    this.destroy = function () {
      if (socket) {
        socket.disconnect();
      }
    };
  };

  var StateMachine = function StateMachine() {
    this.requestState = false;
    this.result = 0;
    this.startTime = 0;
    this.endTime = 0;
    this.key = 0;
    this.index = 0;
    this.ajax = {};
    this.states = [];
    this.snapshoot = [];
    this.drawsAlready = 0;
    this.roomId = options$1.roomId;
    this.userId = options$1.userId;
    this.recordId = options$1.recordId;
    this.liveId = options$1.liveId;
    this.drawRequestTime = options$1.drawRequestTime;

    this.setSnapshoot = function (docId, data) {
      this.snapshoot[docId] = data;
    };

    this.getSnapshoot = function () {
      return this.snapshoot;
    };

    this.init = function (options) {
      for (var i = 0; i < this.drawRequestTime; i++) {
        var s = {
          requestState: false,
          result: 0,
          startTime: options.startTime,
          endTime: options.endTime,
          key: i
        };
        options.startTime = options.startTime + options.blockTime;
        options.endTime = options.startTime + options.blockTime;
        this.setState(s);
      }
    };

    this.httpRequest = function (options, callback) {
      if (!options || !options.url || !options.param) return;
      var self = this;
      self.requestState = true;
      options.param.tpl = initDW.tpl;
      this.ajax = $.ajax({
        url: options.url,
        type: 'GET',
        data: options.param,
        tryCount: 0,
        retryLimit: 3,
        timeout: window.TIMEOUT,
        dataType: 'jsonp',
        success: function success(data) {
          self.result = data;

          if (!data.success) {
            log('data.success', data.success);
            return;
          }

          callback(data);
          self.requestState = false;
        },
        error: function error(xhr, textStatus, errorThrown) {
          if (textStatus == 'timeout') {
            this.tryCount++;

            if (this.tryCount < this.retryLimit) {
              $.ajax(this);
              log('ajax[' + self.key + '] try again tryCount', this.tryCount);
              return;
            } else {
              log('数据请求失败且重试多次');
              self.requestState = false;
              return;
            }
          }

          if (xhr.status == 500) ;
        }
      });
    };

    this.abort = function () {
      this.ajax.abort();
      this.requestState = false;
    };

    this.setState = function (options) {
      if (_typeof(options) !== 'object') {
        return;
      }

      var key = options.key || this.index++;

      if (options.key && !isNaN(options.key)) {
        this.index = _parseInt$2(options.key) + 1;
      }

      var state = new StateMachine();
      state.requestState = options.requestState || this.requestState;
      state.result = options.result || this.result;
      state.startTime = options.startTime || this.startTime;
      state.endTime = options.endTime || this.endTime;
      state.ajax = options.ajax || this.ajax;
      state.snapshoot = options.snapshoot || this.snapshoot;
      state.key = key;
      this.states[key] = state;
    };

    this.getState = function (key) {
      return this.states[key];
    };

    this.getStates = function () {
      return this.states;
    };

    this.getCurrentStateIndex = function (currentTime) {
      var index = 0;

      for (var i = 0; i < this.states.length; i++) {
        if (currentTime > this.states[i].startTime && currentTime <= this.states[i].endTime) {
          index = i;
          break;
        }
      }

      return index;
    };

    this.isDrawsAlready = function () {
      return _parseInt$2(this.drawRequestTime, 10) === _parseInt$2(this.drawsAlready, 10);
    };
  };

  // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)

  var hiddenKeys = _enumBugKeys.concat('length', 'prototype');

  var f$6 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
    return _objectKeysInternal(O, hiddenKeys);
  };

  var _objectGopn = {
  	f: f$6
  };

  // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window

  var gOPN = _objectGopn.f;
  var toString$2 = {}.toString;

  var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
    ? Object.getOwnPropertyNames(window) : [];

  var getWindowNames = function (it) {
    try {
      return gOPN(it);
    } catch (e) {
      return windowNames.slice();
    }
  };

  var f$7 = function getOwnPropertyNames(it) {
    return windowNames && toString$2.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(_toIobject(it));
  };

  var _objectGopnExt = {
  	f: f$7
  };

  // 19.1.2.7 Object.getOwnPropertyNames(O)
  _objectSap('getOwnPropertyNames', function () {
    return _objectGopnExt.f;
  });

  var $Object$3 = _core.Object;

  var meteDataHandles = {
    getReplayRule: function getReplayRule() {
      var data = {
        recordId: initDW.replayId,
        deviceType: DEVICETYPE,
        deviceVersion: VERSION,
        terminal: TERMINAL,
        tpl: initDW.tpl,
        tamp: new Date().getTime()
      };
      return new promise$1(function (resolve, reject) {
        httpGetReplayRule(data, {
          type: 'GET',
          token: initDW.token,
          success: function success(res) {
            if (!res) return;
            var data = JSON.parse(res);

            if (data && data.success === true) {
              resolve(data);
            } else {
              if (typeof window.on_cc_login_error === 'function') {
                data.msg = 'RULEDATA_ERROR';
                window.on_cc_login_error(data);
              }
            }
          },
          fail: function fail(err) {
            reject(err);

            if (typeof window.on_cc_login_error === 'function') {
              err.msg = 'RULEDATA_FAIL';
              err.code = '1001';
              window.on_cc_login_error(err);
            }
          }
        });
      });
    },
    getMetaRule: function getMetaRule(url) {
      return new promise$1(function (resolve, reject) {
        $.getJSON(url, function success(res) {
          if (!res) return;
          resolve(res);
        }).error(function (err) {
          resolve(err);
        });
      });
    },
    getMeta: function getMeta(url) {
      return new promise$1(function (resolve, reject) {
        $.getJSON(url, function success(res) {
          if (!res) return;
          resolve(res);
        }).error(function (err) {
          resolve(err);
        });
      });
    }
  };

  var DrawsInfoRequestPool = function DrawsInfoRequestPool(state, snapshoot) {
    this.state = state;
    this.requestNumber = 2;
    this.httpRequestPool = [];
    this.draws = [];
    this.preState = {};

    this.isHttpRequestCurrentDraws = function (currentTime, fn) {};

    this.httpRequestCurrentDraws = function (options, fn) {};

    this.httpRequestStream = function (url) {};

    this.httpRequestSnapshoot = function (e, currentTime, fn) {};
  };

  window.chatIntervalId = null;
  window.chatPreLoading = false;
  var cc_live_callback_chat_interval = function cc_live_callback_chat_interval() {
    if (chatIntervalId != -1) {
      clearInterval(chatIntervalId);
    }

    chatIntervalId = setInterval(function () {
      var ft = 0;

      try {
        ft = _parseInt$2($('#playbackVideo')[0].currentTime, 10);
      } catch (e) {}

      if (ft <= 0) {
        return;
      }

      if (!window.chatPreLoading) {
        window.chatPreLoading = true;
        var data = {
          time: ft + 300,
          type: 'chat'
        };
        initDW.emit('metaPreLoad', data);
      }

      chatData.nextTime = ft;

      if (Math.abs(chatData.nextTime - chatData.beforeTime) >= 2.5) {
        chatData.isSeek = true;
      } else {
        chatData.isSeek = false;
      }

      var time_buffer = ft - chatData.beforeTime;

      if (time_buffer > 1 && !chatData.isSeek) {
        for (var i = 1; i < time_buffer + 1; i++) {
          var time = chatData.beforeTime + i;
          var curData = chatData.msgs[time];

          if (curData && chatData.nextTime !== chatData.beforeTime) {
            curData.forEach(function (item) {
              callback.chatMessageCache.push(item);
            });
          }
        }
      } else {
        var _curData = chatData.msgs[ft];

        if (_curData && !chatData.isSeek && chatData.nextTime !== chatData.beforeTime) {
          _curData.forEach(function (item) {
            callback.chatMessageCache.push(item);
          });
        }
      }

      chatData.beforeTime = ft;
    }, 1000);
  };
  window.broadcastsIntervalId = null;
  window.broadcastsPreLoading = false;
  var cc_live_callback_broadcasts_interval = function cc_live_callback_broadcasts_interval() {
    if (broadcastsIntervalId != -1) {
      clearInterval(broadcastsIntervalId);
    }

    broadcastsIntervalId = setInterval(function () {
      var ft = 0;

      try {
        ft = _parseInt$2($('#playbackVideo')[0].currentTime, 10);
      } catch (e) {}

      if (ft <= 0) {
        return;
      }

      if (!window.BROADCASTS || !window.BROADCASTS.length) {
        return;
      }

      var broadcast = window.BROADCASTS[0];

      if (!window.broadcastPreLoading) {
        window.broadcastPreLoading = true;
        var data = {
          time: ft + 300,
          type: 'broadcast'
        };
        initDW.emit('metaPreLoad', data);
      }

      while (broadcast.time <= ft) {
        var bc = window.BROADCASTS.shift();
        callback.broadcastCache.push({
          content: bc.content,
          time: bc.time
        });

        if (!window.BROADCASTS.length) {
          break;
        }

        broadcast = window.BROADCASTS[0];
      }
    }, 1000);
  };
  var replayBaseInfo = {};
  window.meteRule = null;
  var getReplayDate = function getReplayDate(opts, fn) {
    var getInitPlayBackData = function getInitPlayBackData() {
      meteDataHandles.getReplayRule().then(function (res) {
        var mateRules = res.data.indexes;
        var mateResource = res.data.resources;
        var currentRules = mateRules[0];
        var currentResource = mateResource[0];
        meteDataHandles.getMetaRule(currentRules).then(function (res) {
          res.currentResource = currentResource;
          initDW.emit('metaRule', res);
        }).catch(function (err) {
          currentRules = mateRules[1];
          currentResource = mateResource[1];
          meteDataHandles.getMetaRule(currentRules).then(function (res) {
            res.currentResource = currentResource;
            initDW.emit('metaRule', res);
          }).catch(function (err) {
            console.log(err, '获取回放元数据规则失败');
          });
        });
      }).catch(function (err) {
        console.log(err, '获取回放规则失败');
      });
      initDW.on('metaRule', function (params) {
        window.meteRule = params;
      });
      initDW.on('seekLoadedChatData', function (t) {
        var seekChatData = [];
        callback.chatLogs.sort(function (p1, p2) {
          return _parseInt$2(p1.time) - _parseInt$2(p2.time);
        });

        for (var index = 0; index < callback.chatLogs.length; index++) {
          var element = callback.chatLogs[index];

          if (element.time <= t) {
            seekChatData.push({
              userid: element.userId,
              username: element.userName,
              time: element.time,
              msg: element.content,
              groupId: element.groupId,
              chatId: element.id,
              status: element.status,
              useravatar: element.userAvatar,
              userRole: element.userRole,
              usercustommark: element.userCustomMark,
              role: element.userRole,
              reply: element.reply,
              at: element.at
            });
          }
        }

        window.on_cc_seeked_chat_msg && window.on_cc_seeked_chat_msg(seekChatData);
      });
      initDW.on('metaPreLoad', function (data) {
        var type = data.type;
        var time = data.time;
        var url = null;
        var docId = '';
        var preDrawsArray = [];
        var seekStatus = initDW.getReplayStatus().seeking;
        var isSeeked = data.isSeeking;

        if (type === 'draw') {
          var drawUrls = initDW.getMetaData().draw;

          keys$1(drawUrls).forEach(function (key) {
            var preLoadTime = _parseInt$2(key);

            if (preLoadTime <= time) {
              var currentUrls = drawUrls[key].urls;
              var filterUrls = [];
              currentUrls.forEach(function (item) {
                if (!item.preLoad) {
                  filterUrls.push({
                    url: item.url,
                    index: item.index
                  });
                }
              });
              if (filterUrls.length <= 0) return;
              preDrawsArray.push({
                urls: filterUrls,
                time: key,
                docId: drawUrls[key].docId
              });
            }
          });

          var preDrawsArrayLength = preDrawsArray.length;

          if (!seekStatus && preDrawsArrayLength > 0) {
            var currentPreDrawMateData = preDrawsArray[0];
            var currentPreDrawMateUrls = currentPreDrawMateData.urls;

            if (currentPreDrawMateUrls.length <= 0) {
              window.drawPreLoading = false;
              return;
            }

            currentPreDrawMateUrls.forEach(function (item) {
              initDW.getMetaData().draw[currentPreDrawMateData.time].urls[item.index].preLoad = true;
              url = item.url;
              docId = currentPreDrawMateData.docId;
              getPreloadMeta(url, type, docId);
            });
            return;
          } else if (seekStatus && preDrawsArrayLength > 0) {
            console.log('metaPreLoad--', preDrawsArray);
            var _currentPreDrawMateData = {};
            preDrawsArray.forEach(function (item) {
              if (item.docId === callback.currentPage) _currentPreDrawMateData = item;
            });
            var _currentPreDrawMateUrls = _currentPreDrawMateData.urls;

            if (_currentPreDrawMateUrls && _currentPreDrawMateUrls.length <= 0) {
              window.drawPreLoading = false;
              return;
            }

            console.log('currentPreDrawMateUrls--', callback.currentPage, _currentPreDrawMateUrls, _currentPreDrawMateData, _currentPreDrawMateUrls);
            _currentPreDrawMateUrls && _currentPreDrawMateUrls.forEach(function (item) {
              initDW.getMetaData().draw[_currentPreDrawMateData.time].urls[item.index].preLoad = true;
              url = item.url;
              docId = _currentPreDrawMateData.docId;
              getPreloadMeta(url, type, docId);
            });
            return;
          }
        } else {
          var preloadUrls = initDW.getMetaData()[type];

          if (data.isSeeking) {
            keys$1(preloadUrls).forEach(function (key) {
              var preLoadTime = _parseInt$2(key);

              if (preLoadTime <= time && !preloadUrls[key].preLoad) {
                preDrawsArray.push({
                  url: preloadUrls[key].url,
                  time: key
                });
              }
            });

            var _preDrawsArrayLength = preDrawsArray.length;

            if (_preDrawsArrayLength > 0) {
              var _currentPreDrawMateData2 = preDrawsArray[_preDrawsArrayLength - 1];
              initDW.getMetaData()[type][_currentPreDrawMateData2.time].preLoad = true;
              url = _currentPreDrawMateData2.url;
            }
          } else {
            var curTime = time - 300;

            keys$1(preloadUrls).forEach(function (key) {
              var preLoadTime = _parseInt$2(key);

              if (preLoadTime >= curTime && preLoadTime <= time && !preloadUrls[key].preLoad) {
                preDrawsArray.push({
                  url: preloadUrls[key].url,
                  time: key
                });
              }
            });

            var _preDrawsArrayLength2 = preDrawsArray.length;

            if (_preDrawsArrayLength2 > 0) {
              var _currentPreDrawMateData3 = preDrawsArray[0];
              initDW.getMetaData()[type][_currentPreDrawMateData3.time].preLoad = true;
              url = _currentPreDrawMateData3.url;
            }
          }
        }

        if (!url) {
          switch (type) {
            case 'chat':
              window.chatPreLoading = false;

              if (isSeeked) {
                initDW.emit('seekLoadedChatData', time);
              }

              break;

            case 'qa':
              window.qaPreLoading = false;
              break;

            case 'broadcast':
              window.broadcastsPreLoading = false;
              break;

            case 'page':
              window.pagePreLoading = false;
              break;

            case 'draw':
              window.drawPreLoading = false;
              break;

            case 'practice':
              window.practicePreLoading = false;
              break;

            case 'animation':
              window.animationPreLoading = false;
              break;
          }

          return;
        }

        getPreloadMeta(url, type, docId, isSeeked, time);
      });
      var data = {
        accountId: initDW.accountId,
        replayId: initDW.replayId,
        deviceType: DEVICETYPE,
        deviceVersion: VERSION,
        terminal: TERMINAL,
        tpl: initDW.tpl
      };
      httpGetMetaDate(data, {
        type: 'GET',
        token: initDW.token,
        success: function success(res) {
          var _replayBaseInfo$templ, _replayBaseInfo$repla, _replayBaseInfo$repla2;

          if (!res) return;
          var data = JSON.parse(res);
          if (!data.data) return false;

          if (!data.success && typeof window.on_cc_login_error === 'function') {
            data.msg = 'METADATA_ERROR';
            window.on_cc_login_error(data);
            return false;
          }

          replayBaseInfo = data.data;

          if (((_replayBaseInfo$templ = replayBaseInfo.template) === null || _replayBaseInfo$templ === void 0 ? void 0 : _replayBaseInfo$templ.chat) === 1 && ((_replayBaseInfo$repla = replayBaseInfo.replay) === null || _replayBaseInfo$repla === void 0 ? void 0 : (_replayBaseInfo$repla2 = _replayBaseInfo$repla.settings) === null || _replayBaseInfo$repla2 === void 0 ? void 0 : _replayBaseInfo$repla2.customEmojiSwitch) === 1) {
            getCustomEmoji();
          }

          var marqueeData = stringify$1(replayBaseInfo.user.marquee);

          if (marqueeData && typeof $.DW.getMarquee === 'function') {
            $.DW.getMarquee(marqueeData);
          }

          if (typeof window.on_cc_login_success === 'function') {
            var template = replayBaseInfo.template;
            template.name = replayBaseInfo.replay.name;
            template.desc = replayBaseInfo.replay.desc;
            var viewer = {
              id: initDW.userId,
              name: initDW.userName,
              groupid: initDW.groupId,
              groupId: initDW.groupId
            };
            var room = {
              'desc': replayBaseInfo.replay.desc,
              'liveStartTime': replayBaseInfo.replay.startTime,
              'name': replayBaseInfo.replay.name,
              'documentDisplayMode': replayBaseInfo.replay.settings.documentDisplayMode,
              'barrage': replayBaseInfo.replay.settings.barrage
            };
            var live = {
              'startTime': replayBaseInfo.replay.startTime,
              'endTime': replayBaseInfo.replay.endTime
            };
            window.on_cc_login_success({
              'template': template,
              'viewer': viewer,
              'room': room,
              'live': live
            });
          }

          if (typeof window.cc_get_room_setting === 'function') {
            window.cc_get_room_setting(replayBaseInfo);
          }

          var drawRequestTime = replayBaseInfo.drawRequestTime ? replayBaseInfo.drawRequestTime : 1;
          options$1.drawRequestTime = _parseInt$2(drawRequestTime) || 1;
          window.TIMEOUT = window.TIMEOUT + options$1.drawRequestTime * 1000;

          if (!DWDpc.fastMode) {
            options$1.drawRequestTime = '';
          }

          window.callback.state = new StateMachine();
          var snapshoot = new StateMachine();
          window.callback.drawsInfoRequestPool = new DrawsInfoRequestPool(window.callback.state, snapshoot);

          if (!meteRule) {
            initDW.on('metaRule', function (params) {
              getInitMetas(params);
            });
          } else {
            getInitMetas(meteRule);
          }

          $.DW.groupId = initDW.groupId;

          if (typeof window.on_cc_callback_player === 'function') {
            window.on_cc_callback_player(data.data);
          }

          if (replayBaseInfo.replay.settings.videoLogo && replayBaseInfo.replay.settings.videoLogo.img) {
            initDW.videoLogo = replayBaseInfo.replay.settings.videoLogo;
          }

          var socketInfo = {
            chat: {},
            viewer: {}
          };
          socketInfo.chat = {
            host: replayBaseInfo.im.primary
          };
          socketInfo.viewer.id = initDW.userId;
          socketInfo.viewer.name = initDW.userName;
          socketInfo.viewer.sessionId = initDW.token;
          socketInfo.recordId = initDW.replayId;
          socketInfo.roomId = opts.roomId;
          callback.socket = new Socket(socketInfo);
        },
        fail: function fail(err) {
          err.msg = 'METADATA_FAIL';
          err.code = '1001';

          if (typeof window.on_cc_login_error === 'function') {
            window.on_cc_login_error(err);
          }
        }
      });
    };

    if (initDW.token && initDW.token.length > 10) {
      getInitPlayBackData();
    } else {
      initDW.login({
        accountId: initDW.accountId,
        replayId: initDW.replayId
      }).then(function (res) {
        getInitPlayBackData();
      });
    }
  };

  function getCustomEmoji() {
    var data = {
      accountId: initDW.accountId,
      replayId: initDW.replayId,
      deviceType: DEVICETYPE,
      deviceVersion: VERSION
    };
    httpGetCustomEmoji(data, {
      type: 'GET',
      token: initDW.token,
      success: function success(res) {
        if (!res) return;
        var data = JSON.parse(res);

        if (data.success) {
          var _data$data, _data$data$customEmoj;

          if ((_data$data = data.data) !== null && _data$data !== void 0 && (_data$data$customEmoj = _data$data.customEmoji) !== null && _data$data$customEmoj !== void 0 && _data$data$customEmoj.length) {
            var customEmoji = {
              customEmojiArr: [],
              customEmojiObj: {}
            };
            data.data.customEmoji.forEach(function (item) {
              customEmoji.customEmojiArr.push(item.name);
              customEmoji.customEmojiObj[item.name] = item.img;
            });

            if (typeof window.on_cc_chat_custom_emjio === 'function') {
              window.on_cc_chat_custom_emjio(customEmoji);
            }
          }
        } else {
          console.error('查询自定义表情失败', data.error);
        }
      },
      fail: function fail(err) {
        console.error('查询自定义表情失败', err);
      }
    });
  }

  function onlyAudio(successful, failed) {
    var data = {
      accountId: initDW.accountId,
      replayId: initDW.replayId,
      deviceType: DEVICETYPE,
      deviceVersion: VERSION,
      terminal: TERMINAL,
      isMp4: 1
    };
    httpGetVideoUrl(data, {
      type: 'GET',
      token: initDW.token,
      success: function success(res) {
        res && successful(res);
      },
      fail: function fail(err) {
        err && failed(err);
      }
    });
  }

  var collectMetaUrls = function collectMetaUrls(type, metas, prefix, currentResource) {
    if (type === 'draw') {
      initDW.getMetaData()[type]['base'] = {
        url: "".concat(currentResource).concat(prefix, "draw_"),
        count: metas.count,
        module: metas.module
      };

      if (metas.global) {
        initDW.getMetaData()[type]['globalDraw'] = {
          url: "".concat(currentResource).concat(prefix).concat(metas.global),
          preLoad: false
        };
      }

      return;
    }

    if (!isArray(metas)) return;
    if (metas.length < 1) return;
    if (!prefix || !currentResource) return;
    if (!initDW.getMetaData()[type]) return;
    metas.forEach(function (item) {
      initDW.getMetaData()[type][item.start] = {
        url: "".concat(currentResource).concat(prefix).concat(item.filename),
        preLoad: false
      };
    });
  };

  var getInitMetas = function getInitMetas() {
    var metaUrls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
    var drawInitMateUrl = arguments.length > 1 ? arguments[1] : undefined;

    if (drawInitMateUrl) {
      meteDataHandles.getMeta(drawInitMateUrl).then(function (res) {
        initDW.getMetaData().draw[0].urls[0].preLoad = true;
        var data = {
          type: 'draw',
          content: res,
          docId: initDW.getMetaData().draw[0].docId
        };
        initDW.emit('mateChange', data);
      });
      return;
    }

    var prefix = metaUrls.prefix;
    var currentResource = metaUrls.currentResource;

    keys$1(metaUrls).forEach(function (key) {
      if (key === 'prefix' || key === 'currentResource') return;
      collectMetaUrls(key, metaUrls[key], prefix, currentResource);
    });

    var streamUrl = initDW.getMetaData().streamSourceRecord[0] && !initDW.getMetaData().streamSourceRecord[0].preLoad ? initDW.getMetaData().streamSourceRecord[0].url : undefined;
    var chatMateUrl = initDW.getMetaData().chat[0] && !initDW.getMetaData().chat[0].preLoad ? initDW.getMetaData().chat[0].url : undefined;
    var qaMateUrl = initDW.getMetaData().qa[0] && !initDW.getMetaData().qa[0].preLoad ? initDW.getMetaData().qa[0].url : undefined;
    var pageMateUrl = initDW.getMetaData().page[0] && !initDW.getMetaData().page[0].preLoad ? initDW.getMetaData().page[0].url : undefined;
    var animationMateUrl = initDW.getMetaData().animation[0] && !initDW.getMetaData().animation[0].preLoad ? initDW.getMetaData().animation[0].url : undefined;
    var broadcastMateUrl = initDW.getMetaData().broadcast[0] && !initDW.getMetaData().broadcast[0].preLoad ? initDW.getMetaData().broadcast[0].url : undefined;
    var practiceMateUrl = initDW.getMetaData().practice[0] && !initDW.getMetaData().practice[0].preLoad ? initDW.getMetaData().practice[0].url : undefined;
    var globalDrawMateUrl = initDW.getMetaData().draw['globalDraw'] && !initDW.getMetaData().draw['globalDraw'].preLoad ? initDW.getMetaData().draw['globalDraw'].url : undefined;

    if (streamUrl) {
      meteDataHandles.getMeta(streamUrl).then(function (res) {
        initDW.getMetaData().streamSourceRecord[0].preLoad = true;
        var data = {
          type: 'stream',
          content: res,
          first: true
        };
        initDW.emit('mateChange', data);
      });
    }

    if (chatMateUrl) {
      meteDataHandles.getMeta(chatMateUrl).then(function (res) {
        initDW.getMetaData().chat[0].preLoad = true;
        var data = {
          type: 'chat',
          content: res,
          first: true
        };
        initDW.emit('mateChange', data);
      });
    }

    if (qaMateUrl) {
      meteDataHandles.getMeta(qaMateUrl).then(function (res) {
        var question = [];
        var answer = [];
        res.forEach(function (element) {
          var questionObj = {};

          for (var key in element) {
            if (key === 'answers') {
              answer = answer.concat(element[key]);
            } else {
              questionObj[key] = element[key];
            }
          }

          question.push(questionObj);
        });
        initDW.getMetaData().qa[0].preLoad = true;
        var data = {
          type: 'qa',
          content: {
            question: question,
            answer: answer
          }
        };
        initDW.emit('mateChange', data);
      });
    }

    if (pageMateUrl) {
      meteDataHandles.getMeta(pageMateUrl).then(function (res) {
        initDW.getMetaData().page[0].preLoad = true;
        var data = {
          type: 'page',
          content: res
        };
        initDW.emit('mateChange', data);
      });
    }

    if (animationMateUrl) {
      meteDataHandles.getMeta(animationMateUrl).then(function (res) {
        initDW.getMetaData().animation[0].preLoad = true;
        var data = {
          type: 'animation',
          content: res
        };
        initDW.emit('mateChange', data);
      });
    }

    if (broadcastMateUrl) {
      meteDataHandles.getMeta(broadcastMateUrl).then(function (res) {
        initDW.getMetaData().broadcast[0].preLoad = true;
        var data = {
          type: 'broadcast',
          content: res,
          first: true
        };
        initDW.emit('mateChange', data);
      });
    }

    if (practiceMateUrl) {
      meteDataHandles.getMeta(practiceMateUrl).then(function (res) {
        initDW.getMetaData().practice[0].preLoad = true;
        var data = {
          type: 'practice',
          content: res
        };
        initDW.emit('mateChange', data);
      });
    }

    if (globalDrawMateUrl) {
      meteDataHandles.getMeta(globalDrawMateUrl).then(function (res) {
        initDW.getMetaData().draw['globalDraw'].preLoad = true;
        var data = {
          type: 'globalDraw',
          content: res
        };
        initDW.emit('mateChange', data);
      });
    }
  };

  var getPreloadMeta = function getPreloadMeta(url, type, docId, isSeeked, seekTime) {
    meteDataHandles.getMeta(url).then(function (res) {
      if (type === 'chat') {
        var data = {
          type: 'chat',
          content: res,
          seek: isSeeked,
          seekTime: seekTime
        };
        initDW.emit('mateChange', data);
      }

      if (type === 'broadcast') {
        var _data2 = {
          type: 'broadcast',
          content: res
        };
        initDW.emit('mateChange', _data2);
      }

      if (type === 'qa') {
        var question = [];
        var answer = [];
        res.forEach(function (element) {
          var questionObj = {};

          for (var key in element) {
            if (key === 'answers') {
              answer = answer.concat(element[key]);
            } else {
              questionObj[key] = element[key];
            }
          }

          question.push(questionObj);
        });
        window.qaPreLoading = false;

        if (question && question.length) {
          question.sort(function (p1, p2) {
            return _parseInt$2(p1.time) - _parseInt$2(p2.time);
          });

          for (var i = 0; i < question.length; i++) {
            var questioninfo = question[i];

            if (typeof window.on_cc_live_qa_question === 'function') {
              window.on_cc_live_qa_question({
                'action': 'question',
                'value': {
                  'id': questioninfo.id,
                  'content': questioninfo.content,
                  'groupId': questioninfo.groupId,
                  'userId': questioninfo.userId,
                  'userName': questioninfo.userName,
                  'userAvatar': questioninfo.userAvatar,
                  'isPublish': questioninfo.isPublish,
                  'isPrivate': questioninfo.isPrivate,
                  'userRole': questioninfo.userRole,
                  'time': questioninfo.time
                }
              });
            }
          }
        }

        if (answer && answer.length) {
          answer.sort(function (p1, p2) {
            return _parseInt$2(p1.time) - _parseInt$2(p2.time);
          });

          for (var _i = 0; _i < answer.length; _i++) {
            var answerinfo = answer[_i];

            if (typeof window.on_cc_live_qa_answer === 'function') {
              window.on_cc_live_qa_answer({
                'action': 'answer',
                'value': {
                  'questionId': answerinfo.id,
                  'content': answerinfo.content,
                  'userId': answerinfo.userId,
                  'isPrivate': answerinfo.isPrivate,
                  'groupId': answerinfo.groupId,
                  'userName': answerinfo.userName,
                  'userAvatar': answerinfo.userAvatar,
                  'userRole': answerinfo.userRole,
                  'time': answerinfo.time
                }
              });
            }
          }
        }
      }

      if (type === 'page') {
        var pages = res;
        var newPages = [];
        pages.sort(function (p1, p2) {
          return _parseInt$2(p1.time) - _parseInt$2(p2.time);
        });

        for (var _i2 = 0; _i2 < pages.length; _i2++) {
          if (!pages[_i2].sign) {
            pages[_i2].sign = 0;
          }

          if (_i2 > 1 && pages[_i2].time === pages[_i2 - 1].time) {
            if (pages[_i2].serverTime < pages[_i2 - 1].serverTime) {
              pages[_i2] = pages[_i2 - 1];
            }

            newPages.pop();
          }

          newPages.push(pages[_i2]);
        }

        var pageChanges = newPages;

        if (pageChanges && pageChanges.length) {
          var len = pageChanges.length;
          var lastTime = -1;
          var _pages = [];
          var listPages = [];

          for (var _i3 = 0; _i3 < len; _i3++) {
            var obj = pageChanges[_i3];

            if (obj.time == lastTime) {
              _pages[_pages.length - 1] = obj;
            } else {
              callback.flipTimes.push(obj.time);
              callback.docsInfo[obj.time] = "".concat(obj.docId, "_").concat(obj.pageNum);

              if (obj.time === 0) {
                callback.currentPage = "".concat(obj.docId, "_").concat(obj.pageNum);
              }

              _pages.push(obj);
            }

            lastTime = obj.time;
            listPages.push(docListDatas(obj));
          }

          window.pagePreLoading = false;
          callback.pageChanges.push.apply(callback.pageChanges, _pages);
          callback.pageChanges.sort(function (p1, p2) {
            return _parseInt$2(p1.time) - _parseInt$2(p2.time);
          });
          callback.docsList.push.apply(callback.docsList, listPages);
          callback.docsList.sort(function (p1, p2) {
            return _parseInt$2(p1.time) - _parseInt$2(p2.time);
          });

          if (typeof window.on_cc_callback_pages === 'function') {
            var _data = JSON.parse(stringify$1(callback.docsList));

            window.on_cc_callback_pages(_data);
          }

          if (initDW.getMetaData().draw && !initDW.getMetaData().draw['pages']) {
            initDW.getMetaData().draw['pages'] = [];
          }

          pageChanges.forEach(function (item) {
            var docid = "".concat(item.docId, "_").concat(item.pageNum);

            if (!initDW.getMetaData().draw['pages'].includes(docid)) {
              var drawMateBaseUrl = initDW.getMetaData().draw.base.url;
              var drawShardCount = item.drawShardCount;
              var drawMateUrls = [];

              for (var m = 0; m < drawShardCount; m++) {
                drawMateUrls.push({
                  url: "".concat(drawMateBaseUrl).concat(item.docId, "_").concat(item.pageNum, "_").concat(m, ".json"),
                  preLoad: false,
                  index: m
                });
              }

              initDW.getMetaData().draw['pages'].push(docid);
              initDW.getMetaData().draw[item.time] = {
                docId: docid,
                urls: drawMateUrls
              };
            }
          });
        }
      }

      if (type === 'draw') {
        var draws = res;
        draws.sort(function (p1, p2) {
          if (p1.timeMills && p2.timeMills) {
            return _parseInt$2(p1.timeMills) - _parseInt$2(p2.timeMills);
          } else {
            return _parseInt$2(p1.time) - _parseInt$2(p2.time);
          }
        });

        if (!callback.newDraws[docId]) {
          callback.newDraws[docId] = {};
        }

        draws.forEach(function (item) {
          if (!callback.newDraws[docId][item.time]) {
            callback.newDraws[docId][item.time] = [];
          }

          callback.newDraws[docId][item.time].push(item);
        });
        window.drawPreLoading = false;
      }

      if (type === 'animation') {
        var _data3 = {
          type: 'animation',
          content: res
        };
        initDW.emit('mateChange', _data3);
        window.animationPreLoading = false;
      }

      if (type === 'practice') {
        var _data4 = {
          type: 'practice',
          content: res
        };
        initDW.emit('mateChange', _data4);
        window.practicePreLoading = false;
      }
    });
  };

  function checkInitMateIsReafy() {
    var metaUrls = initDW.getMetaData();
    var unLoadedMate = [];

    keys$1(metaUrls).forEach(function (key) {
      if (!metaUrls[key][0]) return;

      if (key === 'draw' && metaUrls[key][0].urls.length > 0 && !metaUrls[key][0].urls[0].preLoad) {
        unLoadedMate.push(key);
      }

      if (key !== 'draw' && !metaUrls[key][0].preLoad) {
        unLoadedMate.push(key);
      }
    });

    if (unLoadedMate.length > 0) {
      return false;
    } else {
      initDW.emit('mateReady');
      return true;
    }
  }

  function mateDateReady(opts) {
    var drawPanel = document.getElementById('playbackPanel');

    if (DWDpc.fastMode && drawPanel) {
      if ($('#documentDisplayMode').length <= 0) {
        $('body').append('<input id=\'documentDisplayMode\' type=\'hidden\' value=\'\'>');
      }

      var documentDisplayMode = replayBaseInfo.replay.settings.documentDisplayMode;
      $('#documentDisplayMode').val(documentDisplayMode);
      var script = document.createElement('script');
      script.src = '//image.csslcloud.net/live/2.3.1/dpc.js?v=' + Math.floor(Math.random() * 1000000);

      script.onload = function () {
        DWDpc.appendDrawPanel();
        DWDpc.init({
          roomId: opts.roomId,
          acountId: opts.userId,
          type: 2,
          token: initDW.token,
          openWaterMark: replayBaseInfo.replay.settings.watermark,
          roomWatermark: replayBaseInfo.replay.settings.standardWatermark,
          recordId: opts.recordId,
          roomType: 'replay'
        });
        DWDpc.isDPReady = true;
        window.on_hdLive_drawPanel_complete && window.on_hdLive_drawPanel_complete();
      };

      document.body.appendChild(script);
      callback.isHistoryReady = true;
      callback.drawPanel.isReady = true;
      initDrawPanelInfo();
    }
  }

  var configParam = {};

  var docListDatas = function docListDatas(obj) {
    var listObj = JSON.parse(stringify$1(obj));

    if (replayBaseInfo.replay.settings.standardWatermark === 1 || listObj.sign === 1) {
      if (listObj.url !== '#') {
        listObj.url = 'https://replay-watermark.csslcloud.net/watermark/sign/mark?roomId=' + configParam.roomId + '&accountId=' + configParam.userId + '&hdToken=' + initDW.token + '&sign=' + listObj.sign + '&docId=' + listObj.docId + '&pageNo=' + listObj.pageNum;
      }
    } else {
      var imgUrl = listObj.url;
      var isHttps = window.location.protocol === 'https:';

      if (imgUrl.indexOf('//') > 0 && isHttps) {
        imgUrl = imgUrl.replace('http:', 'https:');
        listObj.url = imgUrl;
      }
    }

    return listObj;
  };

  var History = function History(opts) {
    var _this = this;

    configParam = opts;
    var onCCH5PlayerLoad = false;
    this.mateDateReadyFlag = false;
    getReplayDate(opts);
    initDW.on('mateChange', function (data) {
      var type = data.type;

      if (type === 'page') {
        var pages = data.content;
        var newPages = [];
        pages.sort(function (p1, p2) {
          return _parseInt$2(p1.time) - _parseInt$2(p2.time);
        });

        for (var _i4 = 0; _i4 < pages.length; _i4++) {
          if (!pages[_i4].sign) {
            pages[_i4].sign = 0;
          }

          if (_i4 > 1 && pages[_i4].time === pages[_i4 - 1].time) {
            if (pages[_i4].serverTime < pages[_i4 - 1].serverTime) {
              pages[_i4] = pages[_i4 - 1];
            }

            newPages.pop();
          }

          newPages.push(pages[_i4]);
        }

        var pageChanges = newPages;

        if (pageChanges && pageChanges.length) {
          var len = pageChanges.length;
          var lastTime = -1;
          var _pages2 = [];
          var listPages = [];

          for (var _i5 = 0; _i5 < len; _i5++) {
            var obj = pageChanges[_i5];

            if (obj.time == lastTime) {
              _pages2[_pages2.length - 1] = obj;
            } else {
              callback.flipTimes.push(obj.time);
              callback.docsInfo[obj.time] = "".concat(obj.docId, "_").concat(obj.pageNum);

              if (obj.time === 0) {
                callback.currentPage = "".concat(obj.docId, "_").concat(obj.pageNum);
              }

              _pages2.push(obj);
            }

            lastTime = obj.time;
            listPages.push(docListDatas(obj));
          }

          callback.docsList.push.apply(callback.docsList, listPages);
          callback.pageChanges.push.apply(callback.pageChanges, _pages2);

          if (typeof window.on_cc_callback_pages === 'function') {
            var _data = JSON.parse(stringify$1(callback.docsList));

            window.on_cc_callback_pages(_data);
          }

          if (initDW.getMetaData().draw && !initDW.getMetaData().draw['pages']) {
            initDW.getMetaData().draw['pages'] = [];
          }

          pageChanges.forEach(function (item) {
            var docid = "".concat(item.docId, "_").concat(item.pageNum);

            if (!initDW.getMetaData().draw['pages'].includes(docid)) {
              var drawMateBaseUrl = initDW.getMetaData().draw.base.url;
              var drawShardCount = item.drawShardCount;
              var drawMateUrls = [];

              for (var m = 0; m < drawShardCount; m++) {
                drawMateUrls.push({
                  url: "".concat(drawMateBaseUrl).concat(item.docId, "_").concat(item.pageNum, "_").concat(m, ".json"),
                  preLoad: false,
                  index: m
                });
              }

              initDW.getMetaData().draw['pages'].push(docid);
              initDW.getMetaData().draw[item.time] = {
                docId: docid,
                urls: drawMateUrls
              };
            }
          });
          var firstDrawMetaData = initDW.getMetaData().draw[0];
          var drawInitMateUrl = firstDrawMetaData && firstDrawMetaData.urls.length > 0 && !firstDrawMetaData.urls[0].preLoad ? firstDrawMetaData.urls[0].url : undefined;

          if (drawInitMateUrl) {
            getInitMetas({}, drawInitMateUrl);
          }
        } else {
          if (typeof window.on_cc_callback_pages === 'function') {
            window.on_cc_callback_pages([]);
          }
        }

        if (callback.pageChanges && callback.pageChanges.length) {
          callback.drawPanel.filp(callback.pageChanges[0]);
        }
      }

      if (type === 'animation') {
        var animations = data.content;

        if (animations && animations.length) {
          animations.sort(function (p1, p2) {
            return _parseInt$2(p1.time) - _parseInt$2(p2.time);
          });
          callback.animations.push.apply(callback.animations, animations);
        }
      }

      if (type === 'stream') {
        var streams = data.content;

        if (streams && streams.length) {
          for (var _i6 = 0; _i6 < streams.length; _i6++) {
            var _data5 = streams[_i6];

            var time = _parseInt$2(_data5.time / 1000, 10);

            callback.streamSourceRecord[time] = _data5;
          }
        }
      }

      if (type === 'chat') {
        var chatLogs = data.content;

        if (chatLogs && chatLogs.length) {
          chatLogs.sort(function (p1, p2) {
            return _parseInt$2(p1.time) - _parseInt$2(p2.time);
          });

          for (var _i7 = 0; _i7 < chatLogs.length; _i7++) {
            var chatLog = chatLogs[_i7];
            var chatLogTime = chatLog.time;
            if (!chatData.msgs[chatLogTime]) chatData.msgs[chatLogTime] = [];
            var msg = {
              userid: chatLog.userId,
              username: chatLog.userName,
              time: chatLog.time,
              msg: chatLog.content,
              groupId: chatLog.groupId,
              chatId: chatLog.id,
              status: chatLog.status,
              useravatar: chatLog.userAvatar,
              userRole: chatLog.userRole,
              usercustommark: chatLog.userCustomMark,
              role: chatLog.role,
              reply: chatLog.reply,
              at: chatLog.at
            };
            chatData.msgs[chatLogTime].push(msg);

            if (typeof window.on_cc_live_chat_msg === 'function') {
              window.on_cc_live_chat_msg(msg);
            }
          }

          callback.chatLogs.push.apply(callback.chatLogs, chatLogs);

          if (data.seek) {
            initDW.emit('seekLoadedChatData', data.seekTime);
          }
        }

        if (data.first) {
          cc_live_callback_chat_interval();
        } else {
          window.chatPreLoading = false;
        }
      }

      if (type === 'broadcast') {
        var broadcasts = data.content;

        if (broadcasts && broadcasts.length) {
          broadcasts.sort(function (p1, p2) {
            return _parseInt$2(p1.time) - _parseInt$2(p2.time);
          });

          for (var i = 0; i < broadcasts.length; i++) {
            var broadcast = broadcasts[i];

            if (typeof window.on_cc_live_broadcast_msg == 'function') {
              window.on_cc_live_broadcast_msg({
                content: broadcast.content,
                time: broadcast.time
              });
            }
          }
        }

        if (!window.broadcasts) window.broadcasts = [];
        window.broadcasts = window.broadcasts.concat(broadcasts);

        if (window.broadcasts && window.broadcasts.length) {
          window.BROADCASTS = window.broadcasts;
        }

        if (data.first) {
          cc_live_callback_broadcasts_interval();
        } else {
          window.broadcastPreLoading = false;
        }
      }

      if (type === 'qa') {
        var questions = data.content.question;

        if (questions && questions.length) {
          questions.sort(function (p1, p2) {
            return _parseInt$2(p1.time) - _parseInt$2(p2.time);
          });

          for (var _i8 = 0; _i8 < questions.length; _i8++) {
            var question = questions[_i8];

            if (typeof window.on_cc_live_qa_question === 'function') {
              window.on_cc_live_qa_question({
                'action': 'question',
                'value': {
                  'id': question.id,
                  'content': question.content,
                  'groupId': question.groupId,
                  'userId': question.userId,
                  'userName': question.userName,
                  'userAvatar': question.userAvatar,
                  'isPublish': question.isPublish,
                  'isPrivate': question.isPrivate,
                  'userRole': question.userRole,
                  'time': question.time
                }
              });
            }
          }
        }

        var answers = data.content.answer;

        if (answers && answers.length) {
          answers.sort(function (p1, p2) {
            return _parseInt$2(p1.time) - _parseInt$2(p2.time);
          });

          for (var _i9 = 0; _i9 < answers.length; _i9++) {
            var answer = answers[_i9];

            if (typeof window.on_cc_live_qa_answer === 'function') {
              window.on_cc_live_qa_answer({
                'action': 'answer',
                'value': {
                  'questionId': answer.id,
                  'content': answer.content,
                  'userId': answer.userId,
                  'isPrivate': answer.isPrivate,
                  'groupId': answer.groupId,
                  'userName': answer.userName,
                  'userAvatar': answer.userAvatar,
                  'userRole': answer.userRole,
                  'time': answer.time
                }
              });
            }
          }
        }
      }

      if (type === 'draw') {
        var draws = data.content;
        var docId = data.docId;
        draws.sort(function (p1, p2) {
          if (p1.timeMills && p2.timeMills) {
            return _parseInt$2(p1.timeMills) - _parseInt$2(p2.timeMills);
          } else {
            return _parseInt$2(p1.time) - _parseInt$2(p2.time);
          }
        });

        if (!callback.newDraws[docId]) {
          callback.newDraws[docId] = {};
        }

        draws.forEach(function (item) {
          if (!callback.newDraws[docId][item.time]) {
            callback.newDraws[docId][item.time] = [];
          }

          callback.newDraws[docId][item.time].push(item);
        });
        callback.drawPanel.isReady = true;
      }

      if (type === 'practice') {
        var practices = data.content;

        if (practices && practices.length) {
          practices.sort(function (p1, p2) {
            return _parseInt$2(p1.time) - _parseInt$2(p2.time);
          });
        }

        if (typeof window.on_cc_callback_practices === 'function') {
          window.on_cc_callback_practices(practices);
        }
      }

      if (type === 'globalDraw') {
        var arrayFilter = function arrayFilter(beforeData) {
          var tempArr = [];

          for (var _i10 = 0; _i10 < beforeData.length; _i10++) {
            if (tempArr.indexOf(beforeData[_i10].time) === -1) {
              afterData.push({
                time: beforeData[_i10].time,
                draws: [beforeData[_i10]]
              });
              tempArr.push(beforeData[_i10].time);
            } else {
              for (var j = 0; j < afterData.length; j++) {
                if (afterData[j].time == beforeData[_i10].time) {
                  afterData[j].draws.push(beforeData[_i10]);
                  break;
                }
              }
            }
          }

          return afterData;
        };

        var _draws = data.content;
        var afterData = [];
        var test = arrayFilter(_draws);
        callback.globalDrawsIndex = -1;
        callback.globalDraws.push.apply(callback.globalDraws, test);
      }

      checkInitMateIsReafy();
    });
    initDW.on('mateReady', function () {
      if (!_this.mateDateReadyFlag) mateDateReady(opts);
      _this.mateDateReadyFlag = true;
    });

    window.on_cc_h5_player_load = function () {
      callback.callbackPlayer.isReady = true;

      if (onCCH5PlayerLoad) {
        return;
      }

      onCCH5PlayerLoad = true;
    };

    this.onlyAudio = onlyAudio;

    this.destroy = function () {
      window.meteRule = null;
      chatData.msgs = {};
      this.mateDateReadyFlag = false;
    };
  };

  var ChatMessageCache = function ChatMessageCache() {
    this.cache = [];
    this.lastTimeRefresh = new Date().getTime();
    this.INTERVAL_TIME = setInterval(function () {
      callback && callback.chatMessageCache && callback.chatMessageCache.refresh();
    }, 80);

    this.destroy = function () {
      if (this.INTERVAL_TIME != -1) {
        clearInterval(this.INTERVAL_TIME);
      }

      this.cache = [];
    };

    this.push = function (data) {
      if (this.cache.length > 5000) {
        return;
      }

      this.cache.push(data);
    };

    this.ableRefresh = function () {
      var n = new Date().getTime();

      if (this.cache.length == 0) {
        return false;
      }

      if (n - this.lastTimeRefresh >= 80) {
        return true;
      }

      return false;
    };

    this.refresh = function () {
      if (!this.ableRefresh()) {
        return;
      }

      clearInterval(this.INTERVAL_TIME);
      var d = [];
      var l = Math.min(this.cache.length, 10);

      for (var i = 0; i < l; i++) {
        d.push(this.cache.shift());
      }

      if (typeof window.on_cc_live_chat_msg_sync === 'function') {
        window.on_cc_live_chat_msg_sync(d);
      }

      this.lastTimeRefresh = new Date().getTime();
      this.INTERVAL_TIME = setInterval(function () {
        callback && callback.chatMessageCache.refresh();
      }, 80);
    };
  };

  var BroadcastCache = function BroadcastCache() {
    this.cache = [];
    this.lastTimeRefresh = new Date().getTime();
    this.INTERVAL_TIME = setInterval(function () {
      callback && callback.broadcastCache && callback.broadcastCache.refresh && callback.broadcastCache.refresh();
    }, 80);

    this.push = function (data) {
      if (this.cache.length > 5000) {
        return;
      }

      this.cache.push(data);
    };

    this.destroy = function () {
      if (this.INTERVAL_TIME != -1) {
        clearInterval(this.INTERVAL_TIME);
      }

      this.cache = [];
    };

    this.ableRefresh = function () {
      var n = new Date().getTime();

      if (this.cache.length == 0) {
        return false;
      }

      if (n - this.lastTimeRefresh >= 80) {
        return true;
      }

      return false;
    };

    this.refresh = function () {
      if (!this.ableRefresh()) {
        return;
      }

      clearInterval(this.INTERVAL_TIME);
      var d = [];
      var l = Math.min(this.cache.length, 10);

      for (var i = 0; i < l; i++) {
        d.push(this.cache.shift());
      }

      if (typeof window.on_cc_live_broadcast_msg_sync === 'function') {
        window.on_cc_live_broadcast_msg_sync(d);
      }

      this.lastTimeRefresh = new Date().getTime();
      this.INTERVAL_TIME = setInterval(function () {
        callback.broadcastCache.refresh();
      }, 80);
    };
  };

  var Callback = function Callback(opts) {
    this.streamSourceRecord = {};
    this.chatLogs = [];
    this.broadcasts = [];
    this.draws = [];
    this.pageChanges = [];
    this.isHistoryReady = false;
    this.questions = [];
    this.answers = [];
    this.docsList = [];
    this.animations = [];
    this.practices = [];
    this.lasers = [];
    this.pageChangeIndex = -1;
    this.drawIndex = -1;
    this.animationIndex = -1;
    this.isRequestDraws = false;
    this.flipTimes = [];
    this.currentPage = '';
    this.docDrawIndex = {};
    this.docsInfo = {};
    this.newDraws = {};
    this.globalDraws = [];
    this.globalDrawsIndex = -1;
    this.vodeoPoster = '';
    this.recordVideoSource = [];
    this.currentTime = 0;
    this.currentVideoQuality = 0;
    this.changeVideoQualityStatus = 0;
    this.drawPanel = new DrawPanel$1(opts, this);
    this.history = new History(opts, this);
    this.chatMessageCache = new ChatMessageCache();
    this.broadcastCache = new BroadcastCache();

    this.destroy = function () {
      this.streamSourceRecord = {};
      this.chatLogs = [];
      this.broadcasts = [];
      this.draws = [];
      this.pageChanges = [];
      this.isHistoryReady = false;
      this.questions = [];
      this.answers = [];
      this.docsList = [];
      this.draws = [];
      this.animations = [];
      this.practices = [];
      this.lasers = [];
      this.pageChangeIndex = -1;
      this.drawIndex = -1;
      this.animationIndex = -1;
      this.isRequestDraws = false;
      this.flipTimes = [];
      this.currentPage = '';
      this.docDrawIndex = {};
      this.docsInfo = {};
      this.newDraws = {};
      this.globalDraws = [];
      this.globalDrawsIndex = -1;
      this.vodeoPoster = '';
      this.recordVideoSource = [];
      this.currentTime = 0;
      this.currentVideoQuality = 0;
      this.changeVideoQualityStatus = 0;
      this.history.destroy();
      this.history = null;

      if (this.drawPanel) {
        this.drawPanel.destroy();
        this.drawPanel = null;
      }

      if (this.chatMessageCache) {
        this.chatMessageCache.destroy();
        this.chatMessageCache = null;
      }

      if (this.broadcastCache) {
        this.broadcastCache.destroy();
        this.broadcastCache = null;
      }
    };
  };

  var checkValue = {
    checkValueIsNull: function checkValueIsNull(v) {
      return v == null || v == 'undefined' || v == '' || v == undefined;
    }
  };

  var Bullet = function Bullet() {
    var info;

    var _this = this;
    var xpos = 0;

    this.hideNode = function () {
      if (typeof _this.node != 'undefined') {
        _this.node.className = '';
        _this.node.style.display = 'none';

        _this.container.removeChild(_this.node);
      }
    };

    function animateEnd() {
      _this.hideNode();
    }

    this.setPosition = function (x, y) {
      if (typeof _this.node == 'undefined') return;
      _this.node = document.getElementById('bullet_' + _this.index);
      if (checkValue.checkValueIsNull(_this.node)) return;

      _this.x(x, _this.index);

      _this.y(y);

      _this.node.className = 'bullet active';

      if (document.attachEvent) {
        _this.node.attachEvent('webkitTransitionEnd', animateEnd);

        _this.node.attachEvent('transitionEnd', animateEnd);

        _this.node.attachEvent('mozTransition', animateEnd);

        _this.node.attachEvent('msTransitionEnd', animateEnd);

        _this.node.attachEvent('oTransitionEnd', animateEnd);
      } else {
        _this.node.addEventListener('webkitTransitionEnd', animateEnd);

        _this.node.addEventListener('transitionEnd', animateEnd);

        _this.node.addEventListener('mozTransition', animateEnd);

        _this.node.addEventListener('msTransitionEnd', animateEnd);

        _this.node.addEventListener('oTransitionEnd', animateEnd);
      }
    };

    this.x = function (x) {
      xpos = x;
      var lastNode = document.getElementById('bullet_' + (_this.index - 4));
      if (!lastNode) return;
    };

    this.y = function (y) {
      _this.node.style.top = y + 'px';
    };

    this.width = function () {
      return _this.node.offsetWidth;
    };

    this.height = function () {
      return _this.node.offsetHeight + 5;
    };

    this.isRightAdd = function () {
      if (checkValue.checkValueIsNull(_this.node)) return false;
      var r = _this.node.offsetLeft + _this.width() <= xpos;
      return r;
    };

    function setCss(n) {
      n.className = 'bullet';
    }

    function showEm(str) {
      str = str.replace(/\</g, '&lt;');
      str = str.replace(/\>/g, '&gt;');
      str = str.replace(/\n/g, '<br/>');
      str = str.replace(/\[em_([0-9]*)\]/g, '<img src="//static.csslcloud.net/img/em_mobile/$1.gif" border="0" />');
      str = str.replace(/\[em2_([0-9]*)\]/g, '<img src="//static.csslcloud.net/img/em2_mobile/$1.png" border="0" />');
      str = str.replace(/\[uri_(\S{10,200})\]/g, '<a target="_blank" style="color: #2f53ff" href="$1">$1</a>');
      return str;
    }

    function textModel() {
      var div = document.createElement('div');
      var spanCss = info.css || {
        'color': '#000000',
        font: 'Arial',
        size: 16
      };
      div.innerHTML = '<span style="position: relative;' + 'color:' + spanCss.color + ';font-family: ' + spanCss.font + ';font-size: ' + spanCss.size + ';"   >' + showEm(info.content || '') + '</span>';
      div.id = 'bullet_' + _this.index;
      setCss(div);

      _this.container.appendChild(div);

      return div;
    }

    function imageModel() {
      var img = document.createElement('img');
      img.src = info.src;
      img.id = 'bullet_' + _this.index;
      setCss(img);

      _this.container.appendChild(img);

      return img;
    }

    function createModel() {
      switch (info.type) {
        case 'text':
          textModel();
          break;

        case 'image':
          imageModel();
          break;
      }

      _this.node = document.getElementById('bullet_' + _this.index);
    }

    this.init = function (data, container, i) {
      info = data;
      _this.container = container;
      this.index = i;
      createModel();
    };
  };

  var lines = 4;

  var BulletContainer = function BulletContainer() {
    var container;
    var cacheList = [];
    var useList = [];
    var timeintervalId = -1;

    var _this = this;

    var moveInterval = -1;
    var totalBulletIndex = 0;
    var style;

    this.init = function (l) {
      lines = l;
      container = document.querySelector('#ccBarrage');
      if (typeof container == 'undefined' || typeof container == 'null') return;

      cacheList = [];
      useList = [];
      timeintervalId = -1;
      this.startToRun();
      startToShow();
      creatStyle();
      appendStyle(getCss());
    };

    function getCss() {
      var css = '.bullet{' + 'margin:0px;' + 'padding:0px;' + 'white-space: nowrap;' + 'text-overflow: ellipsis;' + 'overflow: hidden;' + 'word-break: break-all;' + 'max-width: 600px;' + 'position:absolute;' + 'left:' + _this.clienW + 'px;' + 'transition:left 10s;' + 'color:#FFFFFF' + 'white-space: nowrap;' + '-webkit-transition: left 10s linear 0s;' + '-moz-transition: left 10s linear 0s;' + '-ms-transition: left 10s linear 0s;' + '-o-transition: left 10s linear 0s;' + '}\n' + '.active{' + 'left:-' + _this.clienW + 'px;' + '}';
      return css;
    }

    this.close = function () {
      if (moveInterval != -1) {
        clearInterval(moveInterval);
      }

      if (timeintervalId != -1) {
        clearInterval(timeintervalId);
      }

      cacheList = [];
      useList = [];
    };

    function creatStyle() {
      style = document.createElement('style');
      var head = document.head || document.getElementsByTagName('head')[0];
      style.type = 'text/css';
      head.appendChild(style);
    }

    function appendStyle(cssText) {
      if (typeof style == 'undefined') return;

      function addCSS() {
        try {
          style.stylesheet.cssText = cssText;
        } catch (e) {
          alert('css添加过多' + e);
        }
      }

      if (style.stylesheet) {
        if (style.styleSheet.disabled) {
          setTimeout(addCSS, 10);
        } else {
          addCSS();
        }
      } else {
        var textNode = document.createTextNode(cssText);
        style.appendChild(textNode);
      }
    }

    this.isShow = function (b) {
      if (b) {
        container.style.display = 'block';
      } else {
        container.style.display = 'none';
      }
    };

    this.push = function (val) {
      if (cacheList.length > 5000) return;
      if (checkValue.checkValueIsNull(val.type)) return;
      cacheList.push(val);
    };

    this.startToRun = function () {
      if (!container) {
        return;
      }

      container.style.display = 'block';
      this.clienW = container.offsetWidth > 1200 ? container.offsetWidth : 1200;
      this.clienH = container.offsetHeight;
    };

    function creatBullet(da, i) {
      var bullet = new Bullet();
      bullet.init(da, container, totalBulletIndex);
      var llindex = i;
      var top = bullet.height() * llindex;
      bullet.setPosition(_this.clienW, top);
      totalBulletIndex += 1;
    }

    function startToShow() {
      function getList() {
        if (cacheList.length >= lines) {
          useList = cacheList.slice(0, lines);
          cacheList.splice(0, lines);
        } else {
          useList = cacheList.slice(0, cacheList.length);
          cacheList.splice(0, cacheList.length);
        }

        return useList;
      }

      if (moveInterval != -1) return;
      moveInterval = setInterval(function () {
        useList = getList();
        if (useList.length < 1) return;

        for (var i = 0; i < lines; i++) {
          var obj = useList[i];

          if (obj) {
            creatBullet(obj, i);
          }
        }
      }, 3000);
    }
  };

  window.ccCallBack = null;
  window.callback = null;

  function init(opts) {
    options$1.viewerId = opts.viewerid;
    options$1 = $.extend(options$1, opts);
    callback = new Callback(options$1);
  }

  var DW = function (_EventEmitter) {
    _inherits(DW, _EventEmitter);

    var _super = _createSuper(DW);

    function DW(events) {
      var _this2;

      _classCallCheck(this, DW);

      _this2 = _super.call(this, events);
      window.initDW = _assertThisInitialized(_this2);
      window.isDebug = false;
      window.TIMEOUT = 5000;
      _this2.isH5play = true;
      _this2.fastMode = true;
      _this2.forceNew = false;
      _this2.h5canPlay = false;
      _this2.barrage = null;
      _this2.trialDuration = null;
      _this2.isSeek = false;
      _this2.hasDrawedTimeCache = {};
      _this2.seekType = '';
      return _this2;
    }

    _createClass(DW, [{
      key: "config",
      value: function config() {
        var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
        initDW.accountId = opts.userId;
        initDW.replayId = opts.recordId;
        initDW.viewername = opts.viewername;
        initDW.viewertoken = opts.viewertoken;
        initDW.token = opts.token;
        initDW.groupId = opts.groupid;
        initDW.tpl = opts.tpl || 20;
        initCollector(initDW);

        if (checkVideo()) {
          if (opts.isH5play + '' === 'false') {
            this.isH5play = false;
          } else {
            this.isH5play = true;
          }
        } else {
          this.isH5play = false;
        }

        DW.getFastMode(opts);
        DWDpc$1.fastMode = DW.fastMode;

        if (!opts.recordId) {
          warn('未传入有效的recordId');
        }

        var scriptArray = ['//static.csslcloud.net/js/socket.io.js', '//static.csslcloud.net/js/swfobject.js', '//static.csslcloud.net/js/json3.min.js', '//static.csslcloud.net/js/module/drawingBoard-2.0.0.js', '//static.csslcloud.net/js/module/drawingBoardPlayback.js', '//static.csslcloud.net/js/report.js'];

        if (DWDpc$1.fastMode) {
          scriptArray.splice(3, 2);
        }

        loadScript(scriptArray, function () {
          init(opts);

          if (isMobile() && $.DrawingBoard && !DWDpc$1.fastMode) {
            DW.appendDrawPanel();
          }
        });

        if (opts.forceNew && typeof opts.forceNew === 'boolean') {
          this.forceNew = opts.forceNew;
        }

        setTimeout(function () {
          window._swfOk();
        }, 1000);
      }
    }, {
      key: "openBarrage",
      value: function openBarrage(b) {
        if (!this.barrage) {
          this.barrage = new BulletContainer();
          this.barrage.init(4);
        }

        if (b) {
          this.barrage.isShow(true);
        } else {
          this.barrage.isShow(false);
          this.barrage.close();
        }
      }
    }, {
      key: "setBarrage",
      value: function setBarrage(message) {
        if (!this.barrage) {
          this.barrage = new BulletContainer();
          this.barrage.init(4);
        }

        var _barrage = $.trim(message);

        if (!_barrage) return;
        if (_barrage.indexOf('[img_http') > -1) return;
        _barrage = _barrage.replace(/\[em2?_([0-9]*)\]/g, '');
        this.barrage.push({
          type: 'text',
          content: _barrage,
          css: {
            'font': '微软雅黑',
            'size': '14px',
            'color': '#fff'
          }
        });
      }
    }, {
      key: "onlyAudio",
      value: function onlyAudio(metaType, success, failed) {
        callback.history.onlyAudio(function () {
          var res = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
          var data = JSON.parse(res);

          if (data) {
            var audioUrl = data.data.audio[0].primary;
            var videoUrl = data.data.video[callback.callbackPlayer.qualityRate].primary;
            var currentTime = callback.callbackPlayer.getPlayerTime();

            if (metaType) {
              callback.callbackPlayer.getH5player().src = videoUrl;
              callback.callbackPlayer.getH5player().currentTime = currentTime;
              callback.callbackPlayer.getH5player().play();
              success && success();
            } else {
              callback.callbackPlayer.getH5player().src = audioUrl;
              callback.callbackPlayer.getH5player().currentTime = currentTime;
              callback.callbackPlayer.getH5player().play();
              success && success();
            }
          }
        }, function (fail) {
          failed && failed(fail);
        });
      }
    }, {
      key: "showBulletCurtain",
      value: function showBulletCurtain(obj) {
        return callback.callbackPlayer.showBulletCurtain(obj);
      }
    }, {
      key: "addBullet",
      value: function addBullet(msg) {
        return callback.callbackPlayer.addBullet(msg);
      }
    }, {
      key: "setBulletCurtainVisible",
      value: function setBulletCurtainVisible(val) {
        return callback.callbackPlayer.setBulletCurtainVisible(val);
      }
    }, {
      key: "changeQuality",
      value: function changeQuality(quality) {
        if (!quality) return;
        quality = _parseInt$2(quality);
        callback.callbackPlayer.changeQuality(quality);
      }
    }, {
      key: "switchFullScreen",
      value: function switchFullScreen(b) {
        return callback.callbackPlayer.switchFullScreen(b);
      }
    }, {
      key: "appendDrawPanel",
      value: function appendDrawPanel() {
        var dp = '<canvas id="drawPanel" width="1200" height="1200" style="position: absolute;z-index:2;top:0;left: 0"></canvas>' + '<iframe id="dpa" src="" frameborder="0" style="position: absolute;top:0;left: 0"></iframe>';
        $('#playbackPanel').append(dp);
        $('div#playbackPanel').hide();
      }
    }, {
      key: "getPlaybackInfo",
      value: function getPlaybackInfo(opt) {
        if (!opt) {
          return promise$1.reject('请传入回放所需参数～');
        }

        var data = {
          accountId: opt.accountId,
          replayId: opt.replayId,
          deviceType: DEVICETYPE,
          deviceVersion: VERSION,
          tpl: initDW.tpl
        };
        return new promise$1(function (resolve, reject) {
          httpGetPlayBackIntro(data, {
            type: 'GET',
            success: function success(res) {
              if (!res) return;
              var data = JSON.parse(res);

              if (data && data.success === true && data.data) {
                var replayInfo = data.data.replay;
                resolve(replayInfo);
              } else if (data.success === false && data.error) {
                reject(data.error);
              }
            },
            fail: function fail(err) {
              reject(err);
            }
          });
        });
      }
    }, {
      key: "login",
      value: function login(opt) {
        if (!opt) {
          return promise$1.reject('请传入回放所需参数～');
        }

        var data = {
          accountId: initDW.accountId,
          replayId: initDW.replayId,
          deviceType: DEVICETYPE,
          deviceVersion: VERSION,
          userName: initDW.viewername,
          tpl: initDW.tpl
        };

        if (initDW.viewertoken) {
          data.userToken = initDW.viewertoken;
        }

        return new promise$1(function (resolve, reject) {
          httpPostLogin(data, {
            type: 'POST',
            dataType: 'JSON',
            success: function success(res) {
              if (!res) return;
              var data = JSON.parse(res);

              if (data && data.success === true && data.data) {
                var loginInfo = data.data;
                initDW.token = data.data.user.token;
                initDW.id = data.data.id;
                initDW.userName = data.data.user.name;
                initDW.userId = data.data.user.id;
                initDW.replayId = data.data.user.replayId;
                resolve(loginInfo);
              } else if (data.success === false && data.error) {
                if (typeof window.on_cc_login_error === 'function') {
                  window.on_cc_login_error(data.error);
                }

                reject(data.error);
              }
            },
            fail: function fail(err) {
              reject(err);

              if (typeof window.on_cc_login_error === 'function') {
                window.on_cc_login_error(err);
              }
            }
          });
        });
      }
    }, {
      key: "logout",
      value: function logout() {
        var data = {
          accountId: initDW.accountId,
          replayId: initDW.replayId,
          deviceType: DEVICETYPE,
          deviceVersion: VERSION,
          tpl: initDW.tpl
        };
        return new promise$1(function (resolve, reject) {
          httpGetLogout(data, {
            type: 'GET',
            token: initDW.token,
            success: function success(res) {
              if (!res) return;
              var data = JSON.parse(res);
              resolve(data);
            },
            fail: function fail(err) {
              reject(err);
            }
          });
        });
      }
    }, {
      key: "replayMark",
      value: function replayMark() {
        var data = {
          accountId: initDW.accountId,
          replayId: initDW.replayId,
          deviceType: DEVICETYPE,
          deviceVersion: VERSION
        };
        return new promise$1(function (resolve, reject) {
          httpGetReplayMark(data, {
            type: 'GET',
            token: initDW.token,
            success: function success(res) {
              if (!res) return;
              var data = JSON.parse(res);
              resolve(data);

              if (data.success && data.data.points.length > 0) {
                if (typeof window.on_cc_loadDotPointsData === 'function') {
                  window.on_cc_loadDotPointsData(data.data.points);
                }
              }
            },
            fail: function fail(err) {
              reject(err);
            }
          });
        });
      }
    }, {
      key: "playbackRate",
      value: function playbackRate(t) {
        callback.callbackPlayer.playbackRate(t);
      }
    }, {
      key: "seek",
      value: function seek(time) {
        initDW.seekType = 'active';

        var t = _parseInt$2(time);

        initDW.beforeSeekTime = callback.callbackPlayer.playerTime;
        initDW.seekTime = t;
        initDW.setReplayStatus({
          seeking: true
        });
        console.log('seek被调用', initDW.seekType, time);
        var flipTimes = callback.flipTimes;
        var flipTimesLength = flipTimes.length;
        var preFlipTime = [];

        for (var i = 0; i <= flipTimesLength; i++) {
          if (flipTimes[i] <= t) {
            preFlipTime.push(flipTimes[i]);
          }
        }

        var currentFlipTime = preFlipTime[preFlipTime.length - 1];

        if (callback.docsInfo[currentFlipTime]) {
          callback.currentPage = callback.docsInfo[currentFlipTime];
        }

        console.log('调用seek 查询当前的翻页----', callback.currentPage);
        var drawdata = {
          time: t,
          type: 'draw'
        };
        initDW.emit('metaPreLoad', drawdata);
        var pagedata = {
          time: t,
          type: 'page',
          isSeeking: true
        };
        initDW.emit('metaPreLoad', pagedata);
        var animationdata = {
          time: t,
          type: 'animation',
          isSeeking: true
        };
        initDW.emit('metaPreLoad', animationdata);
        var chatdata = {
          time: t,
          type: 'chat',
          isSeeking: true
        };
        initDW.emit('metaPreLoad', chatdata);
        var broadcastdata = {
          time: t,
          type: 'broadcast',
          isSeeking: true
        };
        initDW.emit('metaPreLoad', broadcastdata);
        var qadata = {
          time: t,
          type: 'qa',
          isSeeking: true
        };
        initDW.emit('metaPreLoad', qadata);
        var practicedata = {
          time: t,
          type: 'practice',
          isSeeking: true
        };
        initDW.emit('metaPreLoad', practicedata);
        callback.callbackPlayer.seek(t);
      }
    }, {
      key: "seekBack",
      value: function seekBack(step) {
        if (!step) return;
        var reg = /^\+?[1-9]\d*$/;
        var curTime = this.getPlayerTime();
        var targetTime = curTime - step;
        if (!reg.test(step)) return;
        if (targetTime < 0) targetTime = 0;
        this.seek(targetTime);
      }
    }, {
      key: "seekForward",
      value: function seekForward(step) {
        if (!step) return;
        var reg = /^\+?[1-9]\d*$/;
        var duration = this.getDuration();
        var curTime = this.getPlayerTime();
        var targetTime = curTime + step;
        if (!reg.test(step)) return;
        if (targetTime > duration) targetTime = duration;
        this.seek(targetTime);
      }
    }, {
      key: "getPlayerTime",
      value: function getPlayerTime() {
        try {
          return _parseInt$2(callback.callbackPlayer.getPlayerTime());
        } catch (error) {
          return 0;
        }
      }
    }, {
      key: "destroy",
      value: function destroy() {
        initDW.clear();

        if (callback) {
          callback.destroy();

          if (callback.socket) {
            callback.socket.destroy();
          }

          if (callback.callbackPlayer) {
            callback.callbackPlayer.destroy();
          }

          callback = null;
        }

        if (DWDpc$1) {
          DWDpc$1.destroy();
        }

        clearAllInterval();
      }
    }, {
      key: "getDuration",
      value: function getDuration() {
        try {
          return callback.callbackPlayer.getDuration();
        } catch (error) {
          return 0;
        }
      }
    }, {
      key: "docAdapt",
      value: function docAdapt(t) {
        if (DWDpc$1.fastMode) {
          DWDpc$1.docAdapt(t);
        }

        options$1.adapt = t;
      }
    }, {
      key: "isShowBar",
      value: function isShowBar(n) {
        options$1.isShowBar = n;
      }
    }, {
      key: "getBuffer",
      value: function getBuffer() {
        try {
          return callback.callbackPlayer.getBuffer();
        } catch (error) {
          return 0;
        }
      }
    }, {
      key: "getHistoryPlayTime",
      value: function getHistoryPlayTime() {
        return callback.callbackPlayer.getHistoryPlayTime();
      }
    }, {
      key: "setHistoryPlayTime",
      value: function setHistoryPlayTime(t) {
        return callback.callbackPlayer.setHistoryPlayTime(t);
      }
    }, {
      key: "setVolume",
      value: function setVolume(n) {
        return callback.callbackPlayer.setVolume(n);
      }
    }, {
      key: "getVolume",
      value: function getVolume() {
        return callback.callbackPlayer.getVolume();
      }
    }, {
      key: "play",
      value: function play() {
        return callback.callbackPlayer.play();
      }
    }, {
      key: "setZScale",
      value: function setZScale(s) {
        return callback.callbackPlayer.setZScale(s);
      }
    }, {
      key: "getZScale",
      value: function getZScale() {
        return callback.callbackPlayer.getZScale();
      }
    }, {
      key: "setScale",
      value: function setScale(s) {
        return callback.callbackPlayer.setScale(s);
      }
    }, {
      key: "getScale",
      value: function getScale() {
        return callback.callbackPlayer.getScale();
      }
    }, {
      key: "openSettingPanel",
      value: function openSettingPanel() {
        return callback.callbackPlayer.openSettingPanel();
      }
    }, {
      key: "getReplayPractice",
      value: function getReplayPractice() {
        practice.getReplayPracticeInfo({
          recordId: options$1.recordId
        });
      }
    }, {
      key: "clipVideoImage",
      value: function clipVideoImage() {
        if ($("#playbackPlayer video").length <= 0) return;
        var cavas = document.createElement("canvas");
        var ctx = cavas.getContext("2d");
        var vd = document.querySelector("#playbackVideo");

        if (vd) {
          cavas.width = vd.videoWidth;
          cavas.height = vd.videoHeight;
          ctx.drawImage(vd, 0, 0, vd.videoWidth, vd.videoHeight);
          return cavas.toDataURL();
        }

        return "";
      }
    }, {
      key: "showMarqueeDoc",
      value: function showMarqueeDoc(m) {
        if (DWDpc$1.fastMode) {
          DWDpc$1.showMarquee(m);
        } else {
          DrawPanel.showMarquee(m);
        }
      }
    }, {
      key: "closeMarqueeDoc",
      value: function closeMarqueeDoc() {
        if (DWDpc$1.fastMode) {
          DWDpc$1.closeMarquee();
        }
      }
    }, {
      key: "showMarquee",
      value: function showMarquee(m) {
        callback.callbackPlayer.showMarquee(m);
      }
    }, {
      key: "closeMarquee",
      value: function closeMarquee() {
        callback.callbackPlayer.closeMarquee();
      }
    }, {
      key: "getH5src",
      value: function getH5src(opts) {
        var _this = this;

        var data = {
          accountId: initDW.accountId,
          replayId: initDW.replayId,
          deviceType: DEVICETYPE,
          deviceVersion: VERSION,
          terminal: TERMINAL,
          tpl: initDW.tpl
        };
        httpGetVideoUrl(data, {
          type: 'GET',
          token: initDW.token,
          success: function success(res) {
            if (!res) return;
            var data = JSON.parse(res).data;
            _this.h5canPlay = true;
            var vodeoPoster = data.cover;
            callback.vodeoPoster = vodeoPoster;

            if (data && data.video && data.video.length > 0) {
              var recordVideoSource = data.video;
              callback.recordVideoSource = data.video;
              var syncVideoInfo = [];
              recordVideoSource.forEach(function (element) {
                var item = {};
                item.quality = element.code;
                item.desc = element.desc;
                syncVideoInfo.push(item);
              });

              if (typeof window.HDReceivedVideoQuality === 'function') {
                window.HDReceivedVideoQuality(syncVideoInfo, syncVideoInfo[0]);
              }

              if (typeof window.on_cc_video_quality === 'function') {
                window.on_cc_video_quality(syncVideoInfo, syncVideoInfo[0]);
              }

              var pvdefault = recordVideoSource[0];
              var playurl = pvdefault.primary;
              var secureplayurl = pvdefault.secondary;

              if (!!secureplayurl) {
                playurl = secureplayurl;
              }

              callback.currentVideoQuality = pvdefault.code;
              callback.callbackPlayer.h5playerInit(playurl, vodeoPoster);

              if (data.trialDuration && data.trialDuration > 0) {
                _this.trialDuration = data.trialDuration;
                window.on_cc_player_freetime && window.on_cc_player_freetime(data.trialDuration);
              }
            } else {
              window.on_cc_live_player_load_fail && window.on_cc_live_player_load_fail();
            }
          },
          fail: function fail(err) {
            try {
              var errorInfo = {
                event: 'play',
                code: 400,
                rid: new Date().getTime()
              };
              ccTrack.tragger(errorInfo);
            } catch (error) {}

            window.on_cc_live_player_load_fail && window.on_cc_live_player_load_fail(err);
          }
        });
      }
    }], [{
      key: "getFastMode",
      value: function getFastMode(opt) {
        if (!opt) return;

        if (typeof opt.fastMode === 'string' && opt.fastMode === 'false') {
          this.fastMode = false;
        } else if (typeof opt.fastMode === 'string' && opt.fastMode === 'true') {
          this.fastMode = true;
        } else if (typeof opt.fastMode === 'boolean') {
          this.fastMode = opt.fastMode;
        } else {
          this.fastMode = true;
        }
      }
    }]);

    return DW;
  }(EventEmitter);

  window._swfOk = function () {
    if (typeof window.on_cc_swf_loading_completed === 'function') {
      window.on_cc_swf_loading_completed();
    }
  };

  window.ListenerDuration = function () {
    if (!on_cc_limit_request_draws) {
      return;
    }

    var t = setInterval(function () {
      var duration = _parseInt$2(callback.callbackPlayer.getDuration());

      if (duration) {
        on_cc_limit_request_draws && on_cc_limit_request_draws();
        clearInterval(t);
      }
    }, 50);
    window.ListenerDuration = null;
  };

  window.on_cc_limit_request_draws = function () {
    if (!options$1.drawRequestTime) {
      return;
    }

    var duration = callback.callbackPlayer.getDuration() + 1;
    var blockTime = Math.ceil(duration / options$1.drawRequestTime);
    var startTime = 0;
    var endTime = startTime + blockTime;
    var blockDuration = {
      blockTime: blockTime,
      startTime: startTime,
      endTime: endTime
    };
    callback.state.init(blockDuration);
    callback.drawsInfoRequestPool.httpRequestStream(function (data) {
      callback.draws = data;
      callback.isHistoryReady = true;
      callback.drawPanel.isReady = true;
    });
    setTimeout(function () {
      initDrawPanelInfo();
    }, 1500);
    window.on_cc_limit_request_draws = null;
  };

  window.on_cc_request_snapshoot = function (pageChange) {
    if (!options$1.drawRequestTime) {
      return;
    }

    var currentTime = callback.callbackPlayer.getPlayerTime();
    callback.drawsInfoRequestPool.httpRequestSnapshoot(pageChange, currentTime, function (data) {
      callback.draws = data;
      callback.isHistoryReady = true;
      callback.drawPanel.isReady = true;
    });
  };

  window.on_cc_callback_player = function (data) {
    options$1.upId = data.upId;
    options$1.viewerId = data.user.id;
    callback.callbackPlayer = new CallbackPlayer(options$1);
  };

  window.metaIntervalId = -1;
  window.qaPreLoading = false;
  window.pagePreLoading = false;
  window.drawPreLoading = false;
  window.practicePreLoading = false;
  window.laserPreLoading = false;
  var shareStream = false;

  window.on_cc_live_player_init = function () {
    callback.callbackPlayer.isReady = true;

    try {
      callback.callbackPlayer.getFlash().start();
    } catch (e) {}

    if (chatIntervalId === -1) {
      var curTime = _parseInt$2(callback.callbackPlayer.getPlayerTime());

      if (curTime === 0) {
        window.on_cc_seeked_chat_msg && window.on_cc_seeked_chat_msg([]);
      }

      cc_live_callback_chat_interval();
    }

    if (broadcastsIntervalId === -1) {
      cc_live_callback_broadcasts_interval();
    }

    if (metaIntervalId != -1) {
      clearInterval(metaIntervalId);
      metaIntervalId = -1;
    }

    metaIntervalId = setInterval(function () {
      var ft = 0;

      try {
        ft = _parseInt$2(callback.callbackPlayer.getPlayerTime());
      } catch (e) {}

      if (ft < 0) {
        return;
      }

      if (ft > 0 && ft === _parseInt$2(callback.callbackPlayer.getDuration())) {
        clearAllInterval();
        return;
      }

      if (callback.streamSourceRecord[ft]) {
        var stream = callback.streamSourceRecord[ft];

        if (typeof window.on_cc_live_streaminfo === 'function') {
          window.on_cc_live_streaminfo(stream);
        }

        if (stream.type === 40 || stream.type === 50 || stream.type === 30) {
          shareStream = true;

          if (typeof window.on_cc_live_sharestream_start === 'function') {
            window.on_cc_live_sharestream_start(stream);
          }
        } else {
          if (shareStream === true && typeof window.on_cc_live_sharestream_end === 'function') {
            window.on_cc_live_sharestream_end(stream);
          }

          shareStream = false;
        }
      }

      if (!window.animationPreLoading) {
        window.animationPreLoading = true;
        var data = {
          time: ft + 300,
          type: 'animation'
        };
        initDW.emit('metaPreLoad', data);
      }

      if (!window.qaPreLoading) {
        window.qaPreLoading = true;
        var _data = {
          time: ft + 300,
          type: 'qa'
        };
        initDW.emit('metaPreLoad', _data);
      }

      if (!window.pagePreLoading) {
        window.pagePreLoading = true;
        var _data2 = {
          time: ft + 300,
          type: 'page'
        };
        initDW.emit('metaPreLoad', _data2);
      }

      if (!window.drawPreLoading) {
        window.drawPreLoading = true;
        var _data3 = {
          time: ft + 300,
          type: 'draw'
        };
        initDW.emit('metaPreLoad', _data3);
      }

      if (!window.practicePreLoading) {
        window.practicePreLoading = true;
        var _data4 = {
          time: ft + 300,
          type: 'practice'
        };
        initDW.emit('metaPreLoad', _data4);
      }
    }, 1000);

    if (typeof window.on_cc_live_player_load === 'function') {
      window.on_cc_live_player_load();
    }
  };

  function clearAllInterval() {
    if (chatIntervalId != -1) {
      clearInterval(chatIntervalId);
      chatIntervalId = -1;
    }

    if (broadcastsIntervalId != -1) {
      clearInterval(broadcastsIntervalId);
      broadcastsIntervalId = -1;
    }

    if (metaIntervalId != -1) {
      clearInterval(metaIntervalId);
      metaIntervalId = -1;
    }

    if (callback && callback.drawPanel && callback.drawPanel.intervalNum != -1) {
      clearInterval(callback.drawPanel.intervalNum);
    }
  }

  window.on_drampanel_ready = function () {
    callback.drawPanel.isReady = true;
    setTimeout(function () {
      initDrawPanelInfo();
    }, 1500);
  };

  window.seekStart = function () {
    if (callback && callback.drawPanel && callback.drawPanel.intervalNum != -1) {
      clearInterval(callback.drawPanel.intervalNum);
    }
  };

  window.drawProlading = false;

  window.seekComplete = function () {
    console.log('seekComplete', initDW.seekType);
    var ft = callback.callbackPlayer.getPlayerTime();

    if (ft < 0) {
      ft = 0;
    }

    var seekType = callback.callbackPlayer.playerSeekType;

    if (seekType === 'back' || initDW.beforeSeekTime === -1 && _parseInt$2(ft) === 0) {
      console.log('seekType back', _parseInt$2(ft), initDW.beforeSeekTime, new Date().getTime());
      callback.drawPanel.clear();
      callback.drawPanel.currentDrawTime = -1;
      callback.pageChangeIndex = -1;
      callback.drawIndex = -1;
      callback.animationIndex = -1;
      callback.globalDrawsIndex = -1;
      initDW.hasDrawedTimeCache = {};
    } else {
      console.log('seekType front', _parseInt$2(ft), initDW.beforeSeekTime, new Date().getTime());

      if (callback.drawPanel.currentDrawTime > initDW.beforeSeekTime) {
        callback.drawPanel.currentDrawTime = -1;
      } else {
        callback.drawPanel.currentDrawTime--;
      }
    }

    if (callback.pageChanges && callback.pageChanges.length > 0) {
      callback.pageChanges.sort(function (p1, p2) {
        return _parseInt$2(p1.time) - _parseInt$2(p2.time);
      });

      for (var i = 0; i < callback.pageChanges.length; i++) {
        var pc = callback.pageChanges[i];

        if (ft >= pc.time) {
          callback.pageChangeIndex = i;
        }
      }

      if (callback.pageChangeIndex >= 0) {
        var pc = callback.pageChanges[callback.pageChangeIndex];

        if (typeof window.on_cc_callback_page_change === 'function') {
          window.on_cc_callback_page_change(pc);
        }

        if (typeof window.on_cc_request_snapshoot === 'function') {
          window.on_cc_request_snapshoot(pc);
        }

        if (typeof window.on_cc_callback_pagechange === 'function') {
          window.on_cc_callback_pagechange(pc);
        }

        if (DWDpc$1.fastMode) {
          callback.drawPanel.filp(pc);
        } else {
          callback.drawPanel.filp(stringify$1({
            'fileName': pc.docName,
            'totalPage': pc.docTotalPage,
            'docid': pc.encryptDocId,
            'url': pc.url,
            'page': pc.pageNum,
            'useSDK': pc.useSDK
          }));
        }
      }
    }

    if (callback.animations && callback.animations.length > 0) {
      callback.animations.sort(function (p1, p2) {
        return _parseInt$2(p1.time) - _parseInt$2(p2.time);
      });

      for (var i = 0; i < callback.animations.length; i++) {
        var a = callback.animations[i];

        if (ft >= a.time) {
          callback.animationIndex = i;
        }
      }

      if (callback.animationIndex >= 0) {
        var pidex = callback.pageChangeIndex;

        if (pidex >= 0) {
          var pc = callback.pageChanges[pidex];
          var a = callback.animations[callback.animationIndex];

          if (!!pc && !!a && pc.encryptDocId == a.encryptDocId && ft >= a.time && pc.time <= a.time) {
            if (DWDpc$1.fastMode) {
              callback.drawPanel.animation(a);
            } else {
              callback.drawPanel.animation(stringify$1({
                'fileName': a.docName,
                'totalPage': a.docTotalPage,
                'docid': a.encryptDocId,
                'url': a.url,
                'page': a.pageNum,
                'step': a.step
              }));
            }
          }
        }
      }
    }

    var clearDrawTime = -1;

    if (callback.globalDraws && callback.globalDraws.length > 0) {
      callback.globalDraws.sort(function (p1, p2) {
        return _parseInt$2(p1.time) - _parseInt$2(p2.time);
      });

      for (var i = 0; i < callback.globalDraws.length; i++) {
        var dc = callback.globalDraws[i];

        if (dc) {
          if (ft >= dc.time) {
            var arryFilter = dc.draws;
            arryFilter.forEach(function (element) {
              var _drawData = element;

              if (!DWDpc$1.fastMode) {
                element.data, _readOnlyError("_drawData");
              }

              if (element.data.type === 8) {
                clearDrawTime = element.time;
              }

              if (seekType === 'back') {
                if (ft >= element.time) {
                  if (element.data.type !== 8) {
                    callback.drawPanel.draw(_drawData);
                  }

                  callback.drawPanel.currentGlobalDrawTime = element.time;
                }
              } else if (ft >= element.time && element.time > callback.drawPanel.currentGlobalDrawTime) {
                callback.drawPanel.draw(_drawData);
                callback.drawPanel.currentGlobalDrawTime = element.time;
              }
            });
            callback.globalDrawsIndex = i;
          }
        }
      }
    }

    if (!initDW.hasDrawedTimeCache[callback.currentPage]) {
      initDW.hasDrawedTimeCache[callback.currentPage] = [];
    }

    var currentPageDraws = callback.newDraws[callback.currentPage];
    console.log('seek 当前页画笔', currentPageDraws, _parseInt$2(ft), callback.currentPage);
    currentPageDraws && keys$1(currentPageDraws).forEach(function (key) {
      if (key < _parseInt$2(ft)) {
        console.log('seek 画笔数据', currentPageDraws[key], ft);
        if (initDW.hasDrawedTimeCache[callback.currentPage].includes(key)) return;
        if (clearDrawTime > 0 && key <= clearDrawTime) return;
        if (seekType === 'front' && key < callback.drawPanel.currentDrawTime) return;

        if (DWDpc$1.fastMode) {
          callback.drawPanel.seekDraw(currentPageDraws[key]);
        } else {
          callback.drawPanel.seekDraw(currentPageDraws[key].data);
        }

        initDW.hasDrawedTimeCache[callback.currentPage].push(key);
      }
    });
    setTimeout(function () {
      initDW.setReplayStatus({
        seeking: false
      });

      if (callback.callbackPlayer.beforeSeekStatus === 'play') {
        callback.callbackPlayer.play();
      } else {
        callback.callbackPlayer.play('pause');
      }
    }, 0);
  };

  window.isShowBullet = function (val) {
    getCurrentView().setBulletCurtainVisible(val == 1);
  };

  var isJSON = function isJSON(str) {
    if (typeof str == 'string') {
      try {
        var obj = JSON.parse(str);

        if (_typeof(obj) == 'object' && obj) {
          return true;
        } else {
          return false;
        }
      } catch (e) {
        return false;
      }
    }
  };
  var animationRetryTime = 0;
  window.addEventListener('message', function (event) {
    if (!event || !event.data) return;
    var dpCallBackData = event.data;

    if (isJSON(dpCallBackData)) {
      dpCallBackData = JSON.parse(dpCallBackData);
    }

    var dpCallBackDataAction = dpCallBackData.action;
    if (!dpCallBackDataAction) return;

    switch (dpCallBackDataAction) {
      case 'dpAnimateTimeOutCallback':
        animationRetryTime++;

        if (animationRetryTime > 2) {
          animationRetryTime = 0;
          return;
        }

        var animationData = {
          docId: dpCallBackData.docId,
          pageNum: dpCallBackData.pageNum,
          step: dpCallBackData.currentStepIndex
        };

        if (dpCallBackData.time) {
          animationData.time = dpCallBackData.time;
        }

        DWDpc$1.animationChange(animationData);
        break;

      case 'dpAnimateSliderCompleteCallback':
        animationRetryTime = 0;
        break;
    }
  });

  var dw = new DW();
  var playback = {
    config: dw.config,
    isShowBar: dw.isShowBar,
    changeQuality: dw.changeQuality,
    switchFullScreen: dw.switchFullScreen,
    getBuffer: dw.getBuffer,
    setVolume: dw.setVolume,
    getVolume: dw.getVolume,
    play: dw.play,
    seek: dw.seek,
    seekChat: dw.seekChat,
    setZScale: dw.setZScale,
    getZScale: dw.getZScale,
    setScale: dw.setScale,
    getScale: dw.getScale,
    openSettingPanel: dw.openSettingPanel,
    playbackRate: dw.playbackRate,
    getReplayPractice: dw.getReplayPractice,
    destroy: dw.destroy,
    clipVideoImage: dw.clipVideoImage,
    showMarqueeDoc: dw.showMarqueeDoc,
    getPlayerTime: dw.getPlayerTime,
    getDuration: dw.getDuration,
    logout: dw.logout,
    getPlaybackInfo: dw.getPlaybackInfo,
    login: dw.login,
    replayMark: dw.replayMark,
    openBarrage: dw.openBarrage,
    setBarrage: dw.setBarrage,
    closeMarqueeDoc: dw.closeMarqueeDoc,
    showMarquee: dw.showMarquee,
    closeMarquee: dw.closeMarquee,
    setHistoryPlayTime: dw.setHistoryPlayTime,
    getHistoryPlayTime: dw.getHistoryPlayTime,
    docAdapt: dw.docAdapt,
    onlyAudio: dw.onlyAudio,
    seekBack: dw.seekBack,
    seekForward: dw.seekForward
  };

  return playback;

}());
